摘要: 在使用ui组件时 有时会因为组件限定的数据名称 需要修改 数据的名字 这时就需要使用深拷贝 //在使用 uview 下拉菜单时<u-dropdown-item v-model="value1" title="综合" :options="options1" :disabled="true"></u-d 阅读全文
posted @ 2021-09-03 11:05 98。 阅读(180) 评论(0) 推荐(0)
摘要: //Object.defineProperty 给 vm 添加 与 data 对象的属性 进行读取 和 修改 proxy:function(key){ // 保存vm var me = this; // 给 vm添加指定属性名的属性(使用的属性描述符) Object.defineProperty(m 阅读全文
posted @ 2021-08-19 17:41 98。 阅读(65) 评论(0) 推荐(0)
摘要: <cpn ref="aa"></cpn> //vue获取组件距离顶部距离 console.log('距离顶部高度', this.$refs.aa.$el.offsetTop) //uniapp 在h5页面可以使用vue的获取高度 但是在小程序端需要使用下面方法 同时适合于h5页面 const que 阅读全文
posted @ 2021-06-10 16:04 98。 阅读(1112) 评论(0) 推荐(0)
摘要: <div id="app"> <input type="checkbox" v-model="picked" :true-value="value1" :false-value="value2"> <label> 复选框 </label> <p> {{picked}} </p> <p>{{value 阅读全文
posted @ 2021-06-10 11:29 98。 阅读(1567) 评论(0) 推荐(0)
摘要: click 中使用的修饰符 @click.native 原生点击事件: 1,给vue组件绑定事件时候,必须加上native ,不然不会生效(监听根元素的原生事件,使用 .native 修饰符) v_model 中常用的一些修饰符 lazy修饰符, message 并不是实时改变的,而是在失焦或按回车 阅读全文
posted @ 2021-06-09 14:48 98。 阅读(68) 评论(0) 推荐(0)
摘要: var text ='123 ,456' var arr= text . split (',').reverse ().join(',')//456,123 split ()方法是从,这里分隔未两个数组 reverse()方法未颠倒数组顺序 join() 方法用于把数组中的所有元素放入一个字符串用指 阅读全文
posted @ 2021-06-09 14:30 98。 阅读(70) 评论(0) 推荐(0)
摘要: 1、在项目中store中都store.js文件里添加保存和删除token都全局方法。 // store.js 中都mutation中增加添加和删除token的方法 import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) const st 阅读全文
posted @ 2021-06-06 11:06 98。 阅读(354) 评论(0) 推荐(0)
摘要: 案例 watch: { $route: { handler: function(route) { console.log(route); const query = route.query if (query) { this.redirect = query.redirect this.otherQ 阅读全文
posted @ 2021-05-21 14:45 98。 阅读(1590) 评论(0) 推荐(0)
摘要: this.$store.dispatch() 与 this.$store.commit()方法的区别总的来说他们只是存取方式的不同,两个方法都是传值给vuex的mutation改变statethis.$store.dispatch() :含有异步操作,例如向后台提交数据,写法:this.$store 阅读全文
posted @ 2021-05-19 17:24 98。 阅读(1721) 评论(0) 推荐(0)
摘要: function unique(arr) { return Array.from(new Set(arr)) } var arr1 = unique(arr) arr1获取去重后的数组 阅读全文
posted @ 2021-05-06 18:02 98。 阅读(47) 评论(0) 推荐(0)