Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `<input id="dayparting_switch"
- v-model="options.dayparting"
- v-observe="options.dayparting"
- :cheked="options.dayparting"
- data-off="Disabled" data-on="Enabled" data-toggle="toggle" type="checkbox">`
- Vue.directive('observe', {
- // in the bind function, the 3rd argument is vnode (the VDOM) created by Vue.
- bind(el, bindings, vnode) {
- // vnode.context is the scope where the directive is rendered.
- const vm = vnode.context
- $(el).change(function() {
- vm.$data = 'changed';
- });
- }
- });
Add Comment
Please, Sign In to add comment