好用
yarn add vue-pop-colorpicker
<template>
<color-picker v-model="color"></color-picker>
</template>
<script>
import { VueColorpicker } from 'vue-pop-colorpicker'
export default {
components: {
'color-picker': VueColorpicker
},
data() {
return {
color: '#ff0000'
}
}
}
</script>
不好用
<template>
<chrome-picker name="picker" v-model="colors" />
</template>
<script>
import { Material, Compact, Swatches, Slider, Sketch, Chrome, Photoshop } from 'vue-color'
export default {
components: {
'material-picker': Material,
'compact-picker': Compact,
'swatches-picker': Swatches,
'slider-picker': Slider,
'sketch-picker': Sketch,
'chrome-picker': Chrome,
'photoshop-picker': Photoshop
},
data() {
return {
colors: '#ff0000'
}
}
}
</script>