发布时间:2023-07-04 13:30
1、路由设置
import PageB from '@/pages/PageB'
{
path: '/b',
name: 'PageB',
component: PageB
}
2、设置参数
路由测试
3、获取参数
this.$route.query
1、路由设置
import PageB from '@/pages/PageB'
{
path: '/b',
name: 'PageB',
component: PageB
}
2、设置参数
路由测试
或者
路由测试
3、获取参数
this.$route.query
1、路由设置
import PageB from '@/pages/PageB'
{
path: '/b?name=:name',
name: 'PageB',
component: PageB
}
注意:params方式配置路由参数时需要使用 :参数名
2、设置参数
路由测试
注意:params方式配置路由参数时只能写路由名(name),不能写路径(path)
3、获取参数
this.$route.params
1、路由设置
import PageB from '@/pages/PageB'
{
path: '/b',
name: 'PageB',
component: PageB
}
或者
{
path: '/b?name=:name',
name: 'PageB',
component: PageB
}
2、设置获取参数
this.$router.push({
name: 'PageB',
params: { id: 123, name: '李四' }
})
this.$router.push({
// name: 'PageB',
path: '/b',
query: { id: 123, name: '李四' }
})
this.$router.push({
name: 'PageB',
// path: '/b',
query: { id: 123, name: '李四' }
})
1、$router:路由操作对象 ,只写对象。
2、$route:路由信息对象,只读对象。
3、无论是 router-link 标签,还是 $router.push 方式。用 query 参数配置的,就用 this.$route.query 获取;用 params 参数配置的,就用 this.$route.params 获取。
4、router-link 中 params 配置的无法使用url路径(path),$router.push 中 params 配置的可以使用url路径(path)。
一文讲透,商业智能BI的未来形态,发展现状及前景分析|推荐收藏
k8s编排、Secret加密文件详解,configmap文件详解,基本操作
CV算法评判标准:混淆矩阵、准确率、精确率、召回率、特异度、P-R曲线、AP、mAP、coco标准
公司测试部门来了个00后卷王之王,老油条感叹真干不过,但是...
SAP UI5 ObjectPageLayout 控件使用方法分享
(C语言)字符串处理函数——strcat,strcmp,strcpy,strlen,……
Unity3d 2020.3.10总是出现Hold on...(busy for xxx)... Importing assets进度条问题
强化学习记录——PolicyGradient跑CartPole-v0
用c++设计一个类Line,用于表示二维坐标体系中的任意一条直线并输出该直线的属性。
python网络爬虫精解之Beautiful Soup的使用说明
EasyX库 图形库 入门 常用库函数 (VS2022| 做小游戏 | 按钮 | 键盘读取 | 小球移动 | 音乐加入 | 图片加入|消息框)