12 2020 档案

摘要:字典使用前必须先定义: header = {} header['user-agent'] = user_agent 阅读全文
posted @ 2020-12-18 10:48 #Friday 阅读(62) 评论(0) 推荐(0)
摘要:el: 挂载点; data:数据; methods: 方法; filters: 过滤器; computed:计算属性; directives:自定义指令; watch:监听; beforeCreate created beforeMount mounted beforeUpdate update b 阅读全文
posted @ 2020-12-12 16:58 #Friday 阅读(111) 评论(0) 推荐(0)
摘要:Vue.component('my-component', { data: function(){ return { myValue1: 'abc', myValue2: 123 } }, template: ` <div> <input type="text" v-model="myValue1" 阅读全文
posted @ 2020-12-12 16:53 #Friday 阅读(130) 评论(0) 推荐(0)
摘要:组件使用v-if属性时,对应8种生命周期: beforeCreate created; beforeMount mounted; beforeUpdate updated; beforeDestroy destroyed; 组件使用v-show属性时,对应6种生命周期: beforeCreate c 阅读全文
posted @ 2020-12-12 16:30 #Friday 阅读(84) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-12-09 23:31 #Friday 阅读(42) 评论(0) 推荐(0)
摘要:<div id="app"> <input type="text" v-model="m1"> {{msg}} </div> <script> var m = { m1: 'hello world!' }; var vm = new Vue({ el: '#app', data: m, // 用下面 阅读全文
posted @ 2020-12-08 22:09 #Friday 阅读(134) 评论(0) 推荐(0)
摘要:var vm = new Vue({ el:'#app', data:m, methods:{ }, // 自定义指令用directives directives:{ // 里面有三个函数bind、update、unbind change:{ // 里面有两个参数el, bindings bind: 阅读全文
posted @ 2020-12-07 22:53 #Friday 阅读(74) 评论(0) 推荐(0)
摘要:阻止事件冒泡:使用stop <div @click="func2"> <div @click.stop="func($event)"> <input type="button" value="按钮1"> <input type="button" value="按钮2"> <input type="b 阅读全文
posted @ 2020-12-06 23:14 #Friday 阅读(61) 评论(0) 推荐(0)
摘要:<!-- 1. v-bind属性设定src --> <img v-bind:src="imgUrl"> <!-- 2. 用v-bind的简写模式 --> <img :src="imgUrl"> <!-- 3. v-bind来控制class,字符串:麻烦以及原始,不推荐 --> <div :class 阅读全文
posted @ 2020-12-06 21:05 #Friday 阅读(505) 评论(0) 推荐(0)