随笔分类 - Vue
摘要:1.路由钩子 beforeRouterEnter beforeRouterLeave 参数说明: to:路由将要跳转的路径信息 from:路径跳转前的路径信息 next:路由的控制参数 next() 跳入下一个页面 next('/path') 改变路由的跳转方向,使其跳到另一个路由 next(fal
阅读全文
摘要:1.参数绑定 1.1 要实现这样的效果 点击个人信息,传递参数 或者直接在url中: 1.2 实现步骤 (1)在主页面,main.vue中 (2)在router/index.js中path要加上参数 (3)在Profile.vue中展示参数 1.3 第二种参数绑定的方法:使用props解耦 rout
阅读全文
摘要:1.效果图 上面的页面,有两个功能要点:时间线和分页 Blog.vue <template> <div> <Header></Header> <div class="block"> <el-timeline> <el-timeline-item :timestamp="blog.created" p
阅读全文
摘要:1.先查看在初始化时候有没有安装vue-router 如果没有,安装一下: npm install vue-router --save-dev 2.components目录下存放我们自己写的组件 3.定义一个Content.vue <template> <h1>内容页</h1> </template
阅读全文
只有注册用户登录后才能阅读该文。