vue3-color-pickering
v1.0.0
Published
Vue3 colorPicker
Downloads
5
Readme
VColorPicker
基于Vue3的颜色选择器插件
安装
$ npm install VColorPicker -S
使用
在 main.js/main.ts
文件中引入插件并注册
# main.js / main.ts
import VColorPicker from 'VColorPicker'
app.component('VColorPicker', VColorPicker)
在项目中使用 v-color-picker
<template>
<v-color-picker v-model:color="state.color" />
</template>
<script setup lang="ts">
import { reactive } from 'vue'
const state = reactive({ color: '#ffff' })
</script>
<template>
<v-color-picker v-model:color="color" />
</template>
<script>
import { defineComponent, reactive } from 'vue'
export default defineComponent({
setup() {
const state = reactive({
color: '#ffff'
})
return {
...state
}
}
})
</script>