Answer the question
In order to leave comments, you need to log in
Why doesn't 2-way binding in the directive work?
There is such a directive and heatplate
Vue.directive('tack', {
bind (el, binding, vnode) {
el.style.position = 'fixed'
el.style.top = binding.value + 'px'
}
})
<template>
<div class="hello">
<input type="text" v-model.lazy="directiveValue">
{{directiveValue}}
<h1 v-tack="directiveValue">{{ msg }}</h1>
</div>
</template>
export default {
name: 'HelloWorld',
data () {
return {
msg: 'Welcome to Your Vue.js App',
directiveValue: 0
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question