mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-21 14:13:36 +08:00
perf: 规范template模版中路由写法,不再使用$route和$router,此写法vue-tsc编译不通过
This commit is contained in:
@@ -101,14 +101,14 @@ function onCloseTags() {
|
||||
<el-button class="m-2" @click="onCloseTags">关闭标签</el-button>
|
||||
|
||||
<el-divider />
|
||||
<el-button @click="$router.push({ name: 'Menu1-2-2' })">
|
||||
<el-button @click="router.push({ name: 'Menu1-2-2' })">
|
||||
跳转页内菜单(传name对象,优先推荐)
|
||||
</el-button>
|
||||
<el-button @click="$router.push('/nested/menu1/menu1-2/menu1-2-2')">
|
||||
<el-button @click="router.push('/nested/menu1/menu1-2/menu1-2-2')">
|
||||
跳转页内菜单(直接传要跳转的路径)
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="$router.push({ path: '/nested/menu1/menu1-2/menu1-2-2' })"
|
||||
@click="router.push({ path: '/nested/menu1/menu1-2/menu1-2-2' })"
|
||||
>
|
||||
跳转页内菜单(传path对象)
|
||||
</el-button>
|
||||
@@ -116,7 +116,7 @@ function onCloseTags() {
|
||||
<el-divider />
|
||||
<el-button
|
||||
@click="
|
||||
$router.push({
|
||||
router.push({
|
||||
name: 'Menu1-2-2',
|
||||
query: { text: '传name对象,优先推荐' }
|
||||
})
|
||||
@@ -126,7 +126,7 @@ function onCloseTags() {
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="
|
||||
$router.push({
|
||||
router.push({
|
||||
path: '/nested/menu1/menu1-2/menu1-2-2',
|
||||
query: { text: '传path对象' }
|
||||
})
|
||||
@@ -143,7 +143,7 @@ function onCloseTags() {
|
||||
</el-link>
|
||||
|
||||
<el-divider />
|
||||
<el-button @click="$router.push({ name: 'Empty' })">
|
||||
<el-button @click="router.push({ name: 'Empty' })">
|
||||
跳转无Layout的空白页面
|
||||
</el-button>
|
||||
</el-card>
|
||||
|
||||
Reference in New Issue
Block a user