12 2020 档案
摘要:字典使用前必须先定义: header = {} header['user-agent'] = user_agent
阅读全文
摘要:el: 挂载点; data:数据; methods: 方法; filters: 过滤器; computed:计算属性; directives:自定义指令; watch:监听; beforeCreate created beforeMount mounted beforeUpdate update b
阅读全文
摘要:Vue.component('my-component', { data: function(){ return { myValue1: 'abc', myValue2: 123 } }, template: ` <div> <input type="text" v-model="myValue1"
阅读全文
摘要:组件使用v-if属性时,对应8种生命周期: beforeCreate created; beforeMount mounted; beforeUpdate updated; beforeDestroy destroyed; 组件使用v-show属性时,对应6种生命周期: beforeCreate c
阅读全文
摘要:<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, // 用下面
阅读全文
摘要:var vm = new Vue({ el:'#app', data:m, methods:{ }, // 自定义指令用directives directives:{ // 里面有三个函数bind、update、unbind change:{ // 里面有两个参数el, bindings bind:
阅读全文
摘要:阻止事件冒泡:使用stop <div @click="func2"> <div @click.stop="func($event)"> <input type="button" value="按钮1"> <input type="button" value="按钮2"> <input type="b
阅读全文
摘要:<!-- 1. v-bind属性设定src --> <img v-bind:src="imgUrl"> <!-- 2. 用v-bind的简写模式 --> <img :src="imgUrl"> <!-- 3. v-bind来控制class,字符串:麻烦以及原始,不推荐 --> <div :class
阅读全文

浙公网安备 33010602011771号