随笔分类 - vue
摘要:1、使用 Vue.component() 方法注册组件 2、使用 props 属性传递参数 v-for="item in items": 遍历 Vue 实例中定义的名为 items 的数组,并创建同等数量的组件 :user="item": 将遍历的 item 项绑定到组件中 props 定义的名为
阅读全文
摘要:data里面做了定义 在方法里面进行赋值 用 this.info = repos.data 数据可以请求到,但是会报错 TypeError: Cannot set property 'listgroup' of undefined 主要原因是: 在 then的内部不能使用Vue的实例化的this,
阅读全文
摘要:main.js: 入口文件 index.html App.vue 1、App.vue通过import将HelloWorld.vue这个模块全部导入 3、HelloWrold.vue通过export default将name\data等接口输出 4、App.vue只能访问HellowWorld.vue
阅读全文
摘要:参考:https://www.cnblogs.com/yuri2016/p/7045709.html
阅读全文
摘要:1. yarn add vue-resource 2. main.js引入vue-resource 3. About.vue
阅读全文
摘要:组件绑定事件时 1. 普通组件绑定事件不能添加.native, 添加后事件失效 2. 自定义组件绑定事件需要添加.native, 否则事件无效
阅读全文
摘要:vue不推荐直接在子组件中修改父组件传来的props的值,会报错 [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-rende
阅读全文
摘要:或是 在main.js中接收,test.js使用export default 向外暴露的成员 注意: 1、export default 向外暴露的成员,可以使用任意变量来接收 2、在一个模块中,export default 只允许向外暴露一次 3、在一个模块中,可以同时使用export defaul
阅读全文
摘要:1、根目录配置 vue.config.js, 设置入口文件: index.js 2、index.js 3、APP.vue
阅读全文
摘要:1、render方法的实质就是生成template模板(在#app的作用域里) 2、render是vue2.x新增的一个函数, 这个函数的形参是h 3、vue调用render方法时, 会传入一个createElement函数作为参数(也就是h的实参是createElement函数) 4、create
阅读全文
摘要:preset:预设 vue create demo01 过程中,会保存预设,自动保存着 .vuerc 文件中 .vuerc 文件的位置:C:\Users\Administrator C:\Users\Administrator
阅读全文
摘要:loader (在导入模块暴露出来的资源的时候,分析资源是否是js,如果不是,怎么能把他转化成js能够理解的方式,最后穿插到html里) 在node的眼里,所有的文件都是一个模块,任何一个模块都可以有2个口,一个是入水口,一个是出水口 在node的眼里,所有的文件都是一个模块,任何一个模块都可以有2
阅读全文