color-gradient-picker-vue3
Color and gradient picker for vue3.js. color-gradient-picker 的 vue3 版本
Usage
yarn add color-gradient-picker-vue3
Demo
<template>
<div>
<ColorPicker
:is-gradient="true"
:on-start-change="(color) => onChange(color, 'start')"
:on-change="(color) => onChange(color, 'change')"
:on-end-change="(color) => onChange(color, 'end')"
/>
</div>
</template>
<script setup>
import { ref } from 'vue';
import { ColorPicker } from 'color-gradient-picker-vue3';
import 'color-gradient-picker-vue3/dist/style.css';
const color = ref({
red: 255,
green: 0,
blue: 0,
alpha: 1,
});
const onChange = (attrs, name) => {
color.value = { ...attrs };
};
</script>
Todo