Socket
Socket
Sign inDemoInstall

color-gradient-picker-vue3

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

color-gradient-picker-vue3

Color and gradient picker for vue3.js


Version published
Weekly downloads
165
increased by75.53%
Maintainers
1
Weekly downloads
 
Created
Source

color-gradient-picker-vue3

Color and gradient picker for vue3.js. color-gradient-picker 的 vue3 版本

Usage
yarn add color-gradient-picker-vue3
# or npm install color-gradient-picker-vue3 or pnpm install 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 lang="ts" setup>
    import { ref } from 'vue';
    import type { Ref } from 'vue';
    import ColorPicker from './lib/index';

    interface IPoitItem {
        alpha?: number | string;
        blue?: number | string;
        green?: number | string;
        left?: number | string;
        red?: number | string;
    }

    interface Iattrs {
        degree: number;
        points: [IPoitItem];
        style: string;
        type: string;
    }

    const color: Ref<IPoitItem | Iattrs> = ref({
        red: 255,
        green: 0,
        blue: 0,
        alpha: 1,
    });

    const onChange = (attrs: Iattrs, name: string) => {
        color.value = { ...attrs };
    };
</script>
Todo
  • [] 处理 ts 问题

Keywords

FAQs

Package last updated on 02 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc