![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue.js
G_大侠
这个作者很懒,什么都没留下…
展开
-
el-dialog作为子组件使用,点击自带关闭按钮报错
el-dialog作为子组件使用时,点击dialog自带关闭按钮会报错:[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop’s value. Prop being mutated: “dialogVis原创 2022-04-12 15:28:42 · 3241 阅读 · 0 评论 -
keep-alive 跳转页面后数据缓存不刷新
需求如下:列表页筛选数据后跳到详情页,再返回列表页后页面不能刷新,需保留之前筛选的数据router.js中添加meta属性,keepAlive标记是否开启缓存,isBack标记是否从详情页跳转返回{ path: '/map', name: 'map', component: () => import('@/views/map/index'), hidden: true, meta: { keepAlive: true, isBack: false }原创 2021-05-12 17:33:50 · 410 阅读 · 0 评论 -
Vue前端AES加密解密
在src/utils/aes.js中写加解密函数import CryptoJS from 'crypto-js'; export default { // 随机生成指定数量的16进制key generatekey(num) { let library = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; let key = ""; for (var i .原创 2021-05-08 15:00:26 · 255 阅读 · 0 评论 -
vuecli3中使用swiper6.0以上版本 vue-awesome-swiper4.0以上版本
因为swiper版本的升级,发现之前总结的方法有些不适用了,简单总结一下新版本用法。npm安装npm install swiper vue-awesome-swiper --savemain.js中全局引入import { Swiper as SwiperClass, Pagination, Mousewheel, Autoplay} from 'swiper/core'import getAwesomeSwiper from 'vue-awesome-swiper/d原创 2021-01-21 16:07:06 · 638 阅读 · 0 评论 -
Vue 切换路由后的页面不在顶部
在App.vue中,添加watch事件,监听路由变化,使滚动条复位watch: '$route': (to, from) => document.body.scrollTop = 0 document.documentElement.scrollTop = 0原创 2020-08-28 15:58:39 · 323 阅读 · 0 评论 -
vue中checkbox实现单选效果,且同时禁用其他选项
主要是判断禁用条件:有一个选项被选了且不是被选项<q-checkbox v-model="item.answer" :disable="checkedIndex!=key && checkedIndex!='reset'" @input="choose(key)"></q-checkbox>data: -> checkedIndex: 'reset'methods: choose: (key)->原创 2020-07-30 14:47:00 · 1717 阅读 · 0 评论 -
iView中的DatePicker日期选择控件(开始时间和结束时间约束,结束时间加一天)
iView中的DatePicker日期选择控件(开始时间和结束时间约束)前言:最近做项目需要用到日期选择控件,来做个总结,其中包括开始时间和结束时间的约束,直接上代码(Vue项目)实现效果图:template:<span class="item"> 检测时间: <DatePicker type="date" :options="startTimeOptions" @on-change="startTimeChange" placeholde原创 2020-06-29 18:02:27 · 2055 阅读 · 0 评论 -
vue监听scroll事件
很小的功能,记录一下mounted() { window.addEventListener('scroll', this.handleScroll, true)},methods: { handleScroll: function() { console.log(window.scrollY) }}原创 2019-05-05 17:37:17 · 3100 阅读 · 0 评论 -
vue项目中引入jquery
安装jquerynpm install jquery在webpack.base.conf.js中加入一行代码var webpack = require("webpack")在webpack.base.conf.js中module.exports的最后加入这行代码plugins: [ new webpack.optimize.CommonsChunkPlugin('co...原创 2019-05-05 16:34:31 · 161 阅读 · 0 评论 -
Vue2.0中使用swiper插件 vue-awesome-swiper 指南
网站需要做简单轮播效果,实现之后来总结一下。先附上参考的官方文档链接:https://www.npmjs.com/package/vue-awesome-swiper#custom-swiper-pluginnpm安装npm install vue-awesome-swiper --save在vue项目中的main.js中添加:import 'swiper/dist/css...原创 2019-04-11 11:36:12 · 1021 阅读 · 0 评论