Guest User

Untitled

a guest
Oct 19th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. `<input id="dayparting_switch"
  2. v-model="options.dayparting"
  3. v-observe="options.dayparting"
  4. :cheked="options.dayparting"
  5. data-off="Disabled" data-on="Enabled" data-toggle="toggle" type="checkbox">`
  6.  
  7. Vue.directive('observe', {
  8. // in the bind function, the 3rd argument is vnode (the VDOM) created by Vue.
  9. bind(el, bindings, vnode) {
  10. // vnode.context is the scope where the directive is rendered.
  11. const vm = vnode.context
  12. $(el).change(function() {
  13. vm.$data = 'changed';
  14. });
  15. }
  16. });
Add Comment
Please, Sign In to add comment