Vue.directive("keyup", {
// DOM
bind: function() {
console.log("keyup bind")
},
inserted: function(el, binding, vnode) {
console.log("keyup inserted")
if (that.mubiao.toString() == el.id) {
//console.log("keyup inserted binding.value:" + binding.value)
}
},
update: function(el, binding, vnode, oldVnode) {
//console.log("keyup update binding.value:" + binding.value)
let s = JSON.stringify
console.log("keyup update binding.value:", s(binding.value))
},
componentUpdated: function(el, binding, vnode) {
console.log(
"keyup componentUpdated binding.value:" + binding.value
)
let s = JSON.stringify
let str =
"name: " +
s(binding.name) +
"<br>" +
"value: " +
s(binding.value) +
"<br>" +
"expression: " +
s(binding.expression) +
"<br>" +
"argument: " +
s(binding.arg) +
"<br>" +
"modifiers: " +
s(binding.modifiers) +
"<br>" +
"vnode keys: " +
Object.keys(vnode).join(", ")
console.log("str:", str)
},
unbind: function(el, binding, vnode) {
console.log("unbind")
}
})