import Vue from "vue"
//自定义乘方的命令
Vue.directive("n",{
//初始化的时候
bind:function(el,binding){
el.textContent = Math.pow(binding.value,2)
},
//值发生变化的时候
update:function(el,binding){
el.textContent = Math.pow(binding.value,2)
}
}
)
![导入.png](https://img.haomeiwen.com/i20427831/8846736bb091dedf.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
网友评论