-
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathvModelBoolean.js
More file actions
23 lines (23 loc) · 807 Bytes
/
vModelBoolean.js
File metadata and controls
23 lines (23 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.vModelBoolean = void 0;
// TODO: implement for other inputs as they are added
// Currently only implemented for text input
exports.vModelBoolean = {
beforeMount: (el, { value }, vnode) => {
el.setChecked(value);
// eslint-disable-next-line no-param-reassign, no-underscore-dangle
el._assign = vnode.props['onUpdate:modelValue'];
el.addEventListener('clicked', (isChecked) => {
// eslint-disable-next-line no-underscore-dangle
el._assign(isChecked);
});
},
beforeUpdate: (el, { value, oldValue }) => {
if (value === oldValue) {
return;
}
el.setChecked(value);
},
};
//# sourceMappingURL=vModelBoolean.js.map