A Uncaught TypeError: Cannot read property "match" of null error occurred when using Tabbar in Mint-UI.
UI figure:
the following error occurred when clicking tabbar to switch 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)
the calling code is as follows:
<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>