随笔分类 -  Vue.js

摘要:import {debounce} from 'lodash' //debounce主要用到的就是闭包的思想。 //写法1 watch( ()=searchValue, debounce((newValue)=>{ console.log(newValue) },300) ) //写法二 const 阅读全文
posted @ 2023-01-10 10:15 zeal666 阅读(1229) 评论(0) 推荐(0) 编辑
摘要:vue3中的setup使用 defineOptions({ name: 'userOrder-report', }) 来描述组件的name 如果要使用keep-alive 路由的名字要和组件的名字相同 keepAlive标签中的exclude是对比的组件实例中的name 全局守卫中拿到的to或fro 阅读全文
posted @ 2022-08-10 18:04 zeal666 阅读(50) 评论(0) 推荐(0) 编辑
摘要:<template> <div class="hello"> <p>所有车位:{{total}}</p> <p>虚拟车位:{{this.form.virtual}}</p> <p>固定车位:{{this.form.fixedparking}}</p> <button @click="form.vir 阅读全文
posted @ 2022-05-27 11:24 zeal666 阅读(26) 评论(0) 推荐(0) 编辑
摘要:npm install clipboard 先安装clipboard <template> <div> <div v-for="item in list" :key="item.id"> //data-clipboard-text作为当前点击需要复制的内容 <div class="btn" @cli 阅读全文
posted @ 2022-05-24 10:55 zeal666 阅读(114) 评论(0) 推荐(0) 编辑
摘要:1.vue.js data(){ return { isactive:true; errorClass:'error-text'; activeClass:'active-class' } } computed:{ cactive(){ return { active:this.isactive c 阅读全文
posted @ 2021-07-23 16:47 zeal666 阅读(433) 评论(0) 推荐(0) 编辑
摘要:1.在原生的vue.js中emit里面的事件参数不能修改 2.在ts装饰器@Emit()中,如果@Emit()中没有定义事件参数的时候,@Emit会将回调函数的小驼峰写法转换成kebab-case写法来充当事件参数的名称, 3.在jsx中子组件的this.$emit()中事件参数名称必须使用小驼峰的 阅读全文
posted @ 2021-07-22 15:24 zeal666 阅读(1328) 评论(1) 推荐(0) 编辑
摘要:const routers= [ { path:'/', name:'F', component:FP }, { path:'/secondpage', component:()=>import('../views/secondpage.vue') }, { path:'/thirdpage', c 阅读全文
posted @ 2021-05-14 17:17 zeal666 阅读(5653) 评论(0) 推荐(0) 编辑
摘要:在vue.config.js里添加这个模块 module.exports = { publicPath: "./" }; 阅读全文
posted @ 2021-03-08 17:34 zeal666 阅读(310) 评论(0) 推荐(0) 编辑
摘要://下面是导入app.vue import app from './vue/app.vue' new Vue({ el:'#app', // tempalte会完全替换掉id为app的div里面的内容,所以使用了<app/> template:'<app/>', components:{ app } 阅读全文
posted @ 2020-11-30 11:20 zeal666 阅读(259) 评论(0) 推荐(0) 编辑
摘要:<template id="app1"> <div> <h2>{{acount}}</h2> <button @click="add">+</button> <button @click="sub" v-bind:disabled='acount<=1'>-</button> </div> </te 阅读全文
posted @ 2020-11-26 17:18 zeal666 阅读(101) 评论(0) 推荐(0) 编辑
摘要:body> <div id="app"> <!-- v-bid --> <cpn1 v-bind:cinfor="info"></cpn1> </div> <template id="app1"> <div> <h2>{{cinfor}}</h2> </div> </template> <scrip 阅读全文
posted @ 2020-11-26 11:27 zeal666 阅读(199) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示