vue 页面传值 手机号隐藏
分享给大家:1.路由main.js{path: '/register-success/:user_name',name: 'register-suc',component: RegisterSuccess}在注册的页面,带参数self.$router.push({name: 'register-suc', params: {u
·
分享给大家:
1.路由main.js
{
path: '/register-success/:user_name',
name: 'register-suc',
component: RegisterSuccess
}
self.$router.push({name: 'register-suc', params: {user_name: this.user_name}})
在 注册成功页面去参数
created() {
this.user_name = this.$route.params.user_name
}
然后直接在页面上取
{{user_name}}
使用vue.filter
Vue.filter('toTel', function (value) {
let start = value.slice(0, 3)
let end = value.slice(-4)
return `${start}****${end}`
})
然后页面取值
{{mobile | toTel}}
哈哈哈,完成啦
更多推荐
已为社区贡献2条内容
所有评论(0)