颜色选择器(UI取自微信公众号后台编辑器)
npm i wechat-colorpicker -S
import WeChatColorPicker from 'wechat-colorpicker';
const example = new WeChatColorPicker({
el: '#container', // selector 底层采用了querySelector
click(color) {
console.log(`获得的基础颜色是${color}`);
},
clear() {
console.log('清除');
},
});
example.destroy(); // 销毁实例
MIT LICENSE