Html: <li><a href="#" v-on:click="typeStyle">萨克斯萨克<span></span></a></li> Js: typeStyle: function (e) { var el = e.target; el.style.backgroundColor = 'green'; $(el).css("border","1px so
手动挂载$mount() 如果没有挂载的话,没有关联的 DOM 元素.是获取不到$el的. https://vuejs.org/v2/api/#vm-mount var MyComponent = Vue.extend({ template: '<div>Hello!</div>' }) // create and mount to #app (will replace #app) new MyComponent().$mount('#app') // the above is t
原文:https://www.cnblogs.com/CyLee/p/8425183.html 手动挂载$mount() 如果没有挂载的话,没有关联的 DOM 元素.是获取不到$el的. https://vuejs.org/v2/api/#vm-mount var MyComponent = Vue.extend({ template: '<div>Hello!</div>' }) // create and mount to #app (will replace #app) ne
设置事件源 <label :data-weight="item1.EvaluateWeight" @click='radioClick' :data-id="item1.EvaluateDictId"> 获取事件源 radioClick: function (event) { var el = event.currentTarget; var id = $(el).data("id"); radioClick: function (e