路由优化大师
路由优化大师是一款及简单的路由器设置管理软件,其主要功能是一键设置优化路由、屏广告、防蹭网、路由器全面检测及高级设置等,有需要的小伙伴快来保存下载体验吧!
新学了vue.js中的路由 在之前写的vue的demo上加上了简单的路由例子(来自vue-router 2),但是加上点击后只有地址栏变化,内容并不变.且之前用jquery写的一些效果也失效了.最后找到原因是因为同一个id被启动了两次(第一次是之前使用vue组件时启动的,另外一个是路由时启动的)。
附上部分代码
nbsp;html> <meta> <!-- 引入样式 --> <link><style> body { margin: 0; padding: 0; } .logo { width: 166.65px; height: 60px; position: absolute; } .el-menu-demo { margin-left: 166.65px; } .tac { width: 500px; } .bar2,.bar3{ display: none; } </style><p> </p><p> @@##@@ </p> <el-menu> <el-menu-item>基本资料</el-menu-item> <el-menu-item>培养信息</el-menu-item> <el-menu-item>考核相关</el-menu-item> <el-menu-item>清算</el-menu-item> </el-menu><p> <el-row> <!-- 基本资料--> <el-col> <el-menu> <el-menu-item-group> <!-- 路由链接添加处 --> <router-link><el-menu-item><i></i>基本信息</el-menu-item></router-link> <el-menu-item><i></i>修改密码</el-menu-item> </el-menu-item-group> <el-menu-item-group> <router-link><el-menu-item><i></i>会员信息</el-menu-item></router-link> </el-menu-item-group> <el-menu-item-group> <el-menu-item><i></i>小组信息</el-menu-item> </el-menu-item-group> </el-menu> </el-col> </el-row><!-- 路由内容显示 --></p><p> <router-view></router-view></p> <!-- 先引入 Vue --> <script></script> <script></script> <!-- 引入组件库 --> <script></script> <script></script><script> $(document).ready(function(){ $(".nav1").click(function(){ $(".bar1").show().siblings().hide(); }) $(".nav2").click(function(){ $(".bar2").show().siblings().hide(); }) $(".nav3").click(function(){ $(".bar3").show().siblings().hide(); }) }) </script> <script> //vue组件部分 var Main = { data() { return { activeIndex: '1' }; }, methods: { handleSelect(key, keyPath) { /*console.log(key, keyPath);*/ } } } //vue路由部分 const Information = {template:'<p>foo'} const List = {template:'<p>list'} const routes = [ {path:'/information',component:Information}, {path:'/list',component:List}] const router = new VueRouter({ routes }) const app = new Vue({ router }).$mount('#left-menu') //路由 启动应用 var Ctor = Vue.extend(Main) new Ctor().$mount('#top-menu') //主要就是下面这条语句多余 这是写组件时启动应用所用的语句 //new Ctor().$mount('#left-menu') </script>
前端入门到VUE实战笔记:立即学习
>在学习笔记中,你将探索 前端 的入门与实战技巧!
已抢6799个
抢已抢91603个
抢已抢14417个
抢已抢50597个
抢已抢190548个
抢已抢86251个
抢