vue 二級子路由跳轉不了 bug


vue 二級子路由跳轉不了 bug

@click.prevent

阻止原生事件的冒泡

                                <li class="tools-hover-box-list-item"
                                    v-for="({icon, title, routerName}, j) in list"
                                    :key="j"
                                    // @click="gotoRouter(routerName)">
                                    @click.prevent="gotoRouter(routerName)">
                                    <icon-svg class="item-icon-size" :icon-class="icon" />
                                    <p class="item-title">{{title}}</p>
                                </li>



        gotoRouter (routerName) {
            const path = 'tools/landing-page';
            console.log(`🚀 routerName = ${routerName}`, path);
            // this.$router.push({
            //     path,
            // });
            this.$router.push({
                name: routerName,
            });
        },

打開新頁面

        gotoRouter (routerName) {
            const path = 'tools/landing-page';
            console.log(`🚀 routerName = ${routerName}`, path);
            // this.$router.push({
            //     path,
            // });
            this.$router.push({
                name: routerName,
            });


            // let routerObj = {
            //     name: routerName
            // };

            // const { href } = this.$router.resolve(routerObj);
            // window.open(href, '_blank');
        },

refs



©xgqfrms 2012-2020

www.cnblogs.com 發布文章使用:只允許注冊用戶才可以訪問!



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM