How can I perform the following procedure to update data from a policy in vue.
var select = Vue.directive('select', {
twoWay: true,
bind: function(el, binding, vnode){
// Como acessar op ?????
// this.set()
}
})
new Vue({
el: '#demo',
data: function(){
return {
op: 2
}
}
});
select{
width:200px;
padding:5px;
}
<script src="https://unpkg.com/vue/dist/vue.js"></script><divid="demo">
<p>Opção: {{ op }}</p>
<select v-select>
<option v-bind:value="1">1</option>
<option v-bind:value="2">2</option>
</select>
</div>