Colorpicker
LvColorpicker can be used when a user needs to pick a color. Additionally, a customized color palette can also be passed as an array.
# Playground
#Basic Usage
You can use the LvColorPicker with some basic and complex use cases.You can use v-model for two way binding and updating value.You can set the label to colour picker through label prop.You can set the palette colors by passing a array to colors prop. LightVue color-picker is Both compatible with Vue 2.x and Vue 3.x
#Without input
You can use LvColorPicker without the input. You have to set withoutInput prop true
#Without palette
You can use LvColorPicker without the colour palette. You have to set hidePalette prop true
#Setup
You can import a component and register it as a local and global vue component as follows:
// import the component
import LvColorpicker from 'lightvue/colorpicker';
// Register the component locally
export default {
components: {
LvColorpicker
}
}
// Register the component globally (Vue 2.x)
Vue.component('LvColorpicker', LvColorpicker);
// Register the component globally (Vue 3.x)
const app = Vue.createApp({
// ...
});
app.component('LvColorpicker', LvColorpicker);
app.mount('#app')
#APIs
All of the props, events and slots of the component are mentioned below: