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