Why is the $router.push jump page in Vue? why is the operation in my event not performed after the jump?

The

page is to switch pictures if a picture else a picture this is a component required to import this component

    <footer>
            <ul>
                <li @click="tu_one(1)"><img src="../assets/home_ji.png" v-if="tab == "tab-1""/><img src="../assets/home_ji_fan.png" v-else/></li>
                <li @click="tu_one(2)"><img src="../assets/home_shou.png" v-if="tab == "tab-2""/><img src="../assets/home_shou_fan.png" v-else/></li>
                <li @click="tu_one(3)"><img src="../assets/home_user_fan.png" v-if="tab == "tab-3""/><img src="../assets/home_user.png" v-else/></li>
            </ul>
    </footer>
data(){
            return{
                tab:"tab-2"
            }
        },
            tu_one(num){
                let _num = parseInt(num,10);
                switch (_num){
                    case 1:
                    this.$router.push("/Record");
                        break;
                    case 2:
                    this.$router.push("/home");
                        break;
                    case 3:
                    this.$router.push("/user");
                        break;
                    default:
                        break;
                }
                this.tab = `tab-${_num}`;
                console.log(this.tab);//
            }
        }
The

page jumps normally, but the picture hasn"t moved. Why? How to solve it?

Aug.21,2021

doesn't seem to have methods?

will this footer component be introduced in every router-view component?

The

page jumps directly to the past. The content of the current page should be destroyed. Of course, you can't see the changes in the page.

Menu