07 2022 档案

摘要:const arr = [ {id:1,name:'西瓜',state:true,price:10,count:1} {id:2,name:'西瓜',state:false,price:10,count:1} {id:3,name:'西瓜',state:true,price:10,count:1} 阅读全文
posted @ 2022-07-07 23:02 东八区 阅读(1605) 评论(0) 推荐(0) 编辑
摘要:ref 的妙用 1、引用 dom 元素 <h1 ref="myh1">引用 dom 元素</h1> ​ <script> methods:{ show(){ this.$refs.myh1.stylt.color="red" //获取 dom 元素,使用 ref } } </script> 2、引用 阅读全文
posted @ 2022-07-07 23:00 东八区 阅读(165) 评论(0) 推荐(0) 编辑
摘要:父向子传值 父组件中 定义数据 自定义属性 <left :msg="message" :user="userinfo"></left> //引用的组件 ​ export default{ message:'xinxi', userinfo:{name:'zxy',age:18} } 子组件 prop 阅读全文
posted @ 2022-07-06 23:46 东八区 阅读(20) 评论(0) 推荐(0) 编辑
摘要:在 vue2.x 中,兄弟组件之间共享数据的方案 EventBus 兄弟组件A 数据发送方 import bus from './eventBus.js' ​ export default{ data(){ str:'古诗一首' // 需要发的数据 }, methods:{ bus.$emit('s 阅读全文
posted @ 2022-07-06 23:46 东八区 阅读(45) 评论(0) 推荐(0) 编辑
摘要:什么是 seaJS ? seaJS 是 JS框架,主要功能是 按照不同的先后依赖关系对 JS 文件进行加载。 seaJS 遵守CMD规范。 requireJS 和它相似,都是 JS 框架,但是 requireJS 遵守 AMD 规范。 常用接口 serjs.config({...}) 对sea.js 阅读全文
posted @ 2022-07-06 17:28 东八区 阅读(310) 评论(0) 推荐(0) 编辑
摘要:一、下载安装 nvm 安装包 二、在 nvm 安装位置的 settings.txt 中添加镜像地址 node_mirror:npm.taobao.org/mirrors/node/ npm_mirror:npm.taobao.org/mirrors/npm/ 三、查看当前的版本并查看 nvm 可安装 阅读全文
posted @ 2022-07-05 19:18 东八区 阅读(84) 评论(0) 推荐(0) 编辑
摘要:问1:vue3.0 脚手架报错 The template root requires exactly one element. eslint-plugin-vue 模板根只需要一个元素。Eslint-plugin-vue 解决: 设置搜索eslint-plugin-vue 取消勾选 原因: Vetu 阅读全文
posted @ 2022-07-03 13:18 东八区 阅读(365) 评论(0) 推荐(0) 编辑
摘要:一、环境搭建 1、安装 node.js 2、检查 node.js版本 node -v | node -version 出现版本号,安装成功 3、提高效率,使用淘宝的镜像源 输入 npm install -g cnpm --registry=https://registry.npm.taobao.or 阅读全文
posted @ 2022-07-03 13:15 东八区 阅读(33) 评论(0) 推荐(0) 编辑
摘要:防抖和节流的应用场景 防抖(debounce): n 秒后执行该事件,若在n秒后被重复触发,则重新计时 节流(throttle): n 秒内只运行一次,若在n秒内重复触发,只有一次生效 安装 lodash yarn add lodash npm i lodash -s | npm install - 阅读全文
posted @ 2022-07-01 17:11 东八区 阅读(575) 评论(0) 推荐(0) 编辑

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