【发布时间】:2020-09-29 09:04:40
【问题描述】:
内部选项卡一切正常,但是当我在新选项卡中打开链接时。我收到此错误。
- 这是我的路由器链接(标签索引):
<router-link tag="a" class="cursor-pointer text-primary" :to="{path: 'articles/edit/'+props.row._id}">{{ props.row.title }} </router-link>
-
这是目标页面:
已安装:
mounted () {
const articleId = this.$route.params.id
this.loadArticle(articleId)
},
Vuex
export async function loadArticles ({ commit }, { currentPage, perPage, status, subscriptions, validFrom, validThrough, approved, active, category, search }) {
commit('setArticlesBegin')
try {
const query = {
skip: (currentPage - 1) * perPage,
limit: perPage,
search : search || '',
category: category || '',
validFrom: validFrom || '',
validThrough: validThrough || '',
approved: approved || null,
active: active || null,
}
if (status) {
query.status = status
}
const {total, articles} = await api.getAll(query, 'admin')
commit('setArticles', {
articles,
total,
currentPage
})
} catch (error) {
commit('setError', error)
}
}
【问题讨论】:
标签: vue.js vuex vue-router