add tooltip

This commit is contained in:
Harvey Zack committed 2018-10-24 16:05:34 +08:00
1 parent 8a88fb3043
commit 9aa2bf1588
11 files changed
+64 -25

No files matched your search

+5
View File
@@ -100,3 +100,8 @@ export function getType(val) {
const type = toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, '');
return type;
}
export function tooltip(target, msg, pos = 'up') {
target.setAttribute('data-balloon', msg);
target.setAttribute('data-balloon-pos', pos);
}