压缩字符

This commit is contained in:
Harvey committed 2019-11-22 17:32:09 +08:00
1 parent baaaa4c56c
commit ee90291897
13 files changed
+216 -280

No files matched your search

-27
View File
@@ -1,5 +1,3 @@
import { defineProperty } from './property';
export function query(selector, parent = document) {
return parent.querySelector(selector);
}
@@ -63,28 +61,3 @@ export function tooltip(target, msg, pos = 'up') {
target.setAttribute('aria-label', msg);
target.setAttribute('data-balloon-pos', pos);
}
export function addShowProperty(target, ref, name) {
const className = `art-${name}-show`;
defineProperty(target, 'show', {
get() {
return hasClass(ref, className);
},
set(value) {
if (value) {
addClass(ref, className);
} else {
removeClass(ref, className);
}
target.art.emit(`${name}:toggle`, value);
},
});
defineProperty(target, 'toggle', {
value: () => {
target.show = !target.show;
},
});
}