mt-tabbar切换错误: Cannot read property 'match' of null
使用Mint-UI中的Tabbar时,出现Uncaught TypeError: Cannot read property 'match' of null错误。
UI图:
在点击tabbar切换tab时出现如下错误:
VM3871:1 Uncaught TypeError: Cannot read property 'match' of null
at U (<anonymous>:1:238)
at cn (<anonymous>:1:297)
U @ VM3871:1
cn @ VM3871:1
VM3871:1 Uncaught TypeError: Cannot read property 'match' of null
at U (<anonymous>:1:238)
at an (<anonymous>:1:412)
U @ VM3871:1
an @ VM3871:1
VM3871:1 Uncaught TypeError: Cannot read property 'match' of null
at U (<anonymous>:1:238)
at en (<anonymous>:1:527)
U @ VM3871:1
en @ VM3871:1
VM3871:1 Uncaught TypeError: Cannot read property 'match' of null
at U (<anonymous>:1:238)
at cn (<anonymous>:1:297)
U @ VM3871:1
cn @ VM3871:1
VM3871:1 Uncaught TypeError: Cannot read property 'match' of null
at U (<anonymous>:1:238)
at an (<anonymous>:1:412)
U @ VM3871:1
an @ VM3871:1
VM3871:1 Uncaught TypeError: Cannot read property 'match' of null
at U (<anonymous>:1:238)
at en (<anonymous>:1:527)
调用代码如下:
<template>
<div>
<router-view></router-view>
<mt-tabbar fixed v-model="selected">
<mt-tab-item id="tab1" @click.native="goTo('/main/home')">
<img slot="icon" src="../assets/logo.png">
首页
</mt-tab-item>
<mt-tab-item id="tab2" @click.native="goTo('/main/info')">
<img slot="icon" src="../assets/logo.png">
发现
</mt-tab-item>
<mt-tab-item id="tab3" @click.native="goTo('/main/learning')">
<img slot="icon" src="../assets/logo.png">
交流
</mt-tab-item>
<mt-tab-item id="tab4" @click.native="goTo('/main/industry')">
<img slot="icon" src="../assets/logo.png">
我的
</mt-tab-item>
</mt-tabbar>
</div>
</template>
<script>
export default {
name: "Main",
methods: {
goTo(path) {
this.$router.replace(path);
}
},
data() {
return {
selected: "tab4",
}
}
}
</script>
<style scoped>
</style>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论