- 博客(10)
- 收藏
- 关注
原创 vue定义全局变量使用
在src目录下新建utils文件夹,然后自定义方法。在自定义的commonFun.js中。最后在想要使用的页面调用就ok了。在main.js中引入挂载使用。
2023-03-17 13:12:19
164
转载 vue在beforeRouteLeave中使用vant的弹窗,弹出就消失
beforeRouteLeave (to, from, next) { if (this.isBack) { next() } else { setTimeout(() => { this.$dialog.alert({ title: '当前数据还未保存,是否确认退出?', confirmButtonColor: '#1da4f2', // 确认按钮颜色 showCancelButt..
2022-02-18 16:41:28
949
2
转载 vue使用keepalive
我们在定义路由是,在元信息中再加一个字段,这里是deepth字段,代表进入路由的层级,比如首页路由deepth是0.5,列表页是1,详情页是2 new Router({ routes: [ { path: '/', name: 'index', component: () => import('./views/keep-alive/index.vue'), meta: { .
2022-02-11 17:25:32
517
原创 vue使用vant组件,van-pull-refresh和van-list分页加载及下拉刷新
<van-pull-refresh v-model="refreshing" @refresh="onRefresh"> <van-list v-model="loading" :finished="finished" :finished-text="list.length > 0 ? '已经到底了' : ''" @load="onLoad" > <div v-for='item in .
2022-02-11 17:18:03
4070
1
原创 【无标题】
在vue运行中报错Cannot read property ‘dirname’ of undefined因为使用rem屏幕自适应,所以在postscssrc.js中需要重新配置项/** * PostCSS 配置文件 */module.exports = { // 配置要使用的 PostCSS 插件 plugins: { // 配置使用 autoprefixer 插件 // 作用:生成浏览器 CSS 样式规则前缀 // VueCLI 内部已经配置了 autopref
2021-12-31 09:03:25
93
原创 vue点击上移下移 动画
如果是for循环内容需要用到 transition-group标签vue的页面 <transition-group name="flip-list"> <div class="removeCode" v-for="(item, index) in selectList" :key="item" > <div>
2021-09-13 15:51:38
1945
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人