<div v-zns>asdljasd</div> | |
</div> | |
<script src="libs/vue.js"></script> | |
<script> | |
Vue.directive("zns",function(){ | |
var { | |
el | |
} = this; | |
el.style.width="200px"; | |
el.style.height="200px"; | |
el.style.backgroundColor="blue"; | |
el.style.color = "red"; | |
}); | |
new Vue({ | |
el:"#box", | |
data:{}, | |
methods:{} | |
}) |