会员
周边
新闻
博问
闪存
赞助商
YouClaw
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
菜鸟需勤奋
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
24
25
26
27
28
29
30
31
32
···
48
下一页
2022年11月24日
vueCli2路径别名
摘要: 使用方式 路径前面加上~ import方式导入不需要加~
阅读全文
posted @ 2022-11-24 20:11 iTao0128
阅读(38)
评论(0)
推荐(0)
2022年11月23日
父组件传子组件参数限制String类型
摘要: <template> <div class="tab-bar-item" @click="itemClick"> <div v-if="!isActive"><slot name="item-icon"></slot></div> <div v-else><slot name="item-icon-
阅读全文
posted @ 2022-11-23 22:40 iTao0128
阅读(62)
评论(0)
推荐(0)
2022年11月21日
keep-alive
摘要: keep-alive是vue内置组件,可以使被包含的组件保留状态,避免重新渲染 router-view也是一个组件,如果之间被包在keep-alive里面,所有路径被匹配到的视图组件都会被缓存 切换home组件时的created只会被执行一次,destroyed不会被执行,即始终保持组件活跃状态 k
阅读全文
posted @ 2022-11-21 22:30 iTao0128
阅读(174)
评论(0)
推荐(0)
vue-router组件内的守卫
摘要: 参考文档: https://router.vuejs.org/zh/guide/advanced/navigation-guards.html 路由独享的守卫 进入路由之前回调 组件内的守卫
阅读全文
posted @ 2022-11-21 22:10 iTao0128
阅读(39)
评论(0)
推荐(0)
2022年11月20日
vue-router全局导航守卫
摘要: 实现组件跳转时,浏览器标题更新 ①router的index.js文件中 routes配置添加meta属性 ②router.beforeEach方法 import Vue from 'vue' import VueRouter from 'vue-router' const Home = () =>
阅读全文
posted @ 2022-11-20 22:08 iTao0128
阅读(115)
评论(0)
推荐(0)
2022年11月19日
vue-router参数传递
摘要: 通过query传递 使用$route获取query对象 通过代码跳转路由的方式传递参数 <template> <div id="app"> <router-link to="/home" tag="button" >首页</router-link> <router-link to="/about"
阅读全文
posted @ 2022-11-19 17:15 iTao0128
阅读(39)
评论(0)
推荐(0)
路由的嵌套
摘要: home路径下配置一个news和message子路径 import Vue from 'vue' import VueRouter from 'vue-router' const Home = () => import('../components/Home') const HomeNews = (
阅读全文
posted @ 2022-11-19 16:05 iTao0128
阅读(72)
评论(0)
推荐(0)
路由懒加载
摘要: 推荐使用下面的方法 import Vue from 'vue' import VueRouter from 'vue-router' const Home = () => import('../components/Home') const About = () => import('../comp
阅读全文
posted @ 2022-11-19 12:36 iTao0128
阅读(34)
评论(0)
推荐(0)
动态路由的使用
摘要: :to绑定参数 /:参数名,进行拼接参数 $route.params.参数名,取参数值
阅读全文
posted @ 2022-11-19 12:16 iTao0128
阅读(29)
评论(0)
推荐(0)
2022年11月18日
通过代码跳转路由
摘要: <template> <div id="app"> <button @click="toHome">首页</button> <button @click="toAbout">关于</button> <!-- 相当于占位符 --> <router-view></router-view> </div>
阅读全文
posted @ 2022-11-18 22:38 iTao0128
阅读(33)
评论(0)
推荐(0)
上一页
1
···
24
25
26
27
28
29
30
31
32
···
48
下一页
公告