this.$route.query刷新后类型改变

获取this.$route.query传递的参数,通常为number,但是在页面刷新后会转变为string,
这样基于此的判断条件就不生效了。
解决方法:
通过parseInt
手动转变数据类型。
例:
this.intotype = parseInt(this.$route.query.type)
if (this.intotype === 2) {
this.dialogTitle = '上传短视频'
this.labelName = '短视频'
}
posted @ 2021-01-28 16:45  晓晓晓程序媛  阅读(1122)  评论(0编辑  收藏  举报