更新时间:2019-08-26 22:39:51
需要调用colorpicker.js
<script src="./colorpicker.js"></script>
html中将个一个div作为容器id设置为color-picker
<div id="color-picker""></div>
js调用插件
Colorpicker.create({ el: "color-picker", color: "#000fff", change: function(elem, hex) { console.log(elem, hex) } })
或者
new Colorpicker({ el: "color-picker", color: "#000fff", change: function(elem, hex) { console.log(elem, hex) } })