Vue wrapper for EyeDropper instance
npm i vue-eye-dropper
Import and register component
Global
import { createApp } from 'vue'
import App from './App.vue'
import { EyeDropper } from 'vue-eye-dropper'
const app = createApp(App)
app.component('EyeDropper', EyeDropper)
Local
<script setup lang="ts">
import { EyeDropper } from 'vue-eye-dropper'
const handleColorPicked = (color: string) => {
console.log('Color picked:', color)
}
</script>
<template>
<EyeDropper default-color="#fff" :height="25" :width="25" @colorPicked="handleColorPicked" />
</template>
Browser Support
Browser | Version |
---|---|
Chrome | 95-125 |
Edge | 121 |
Opera | 81-106 |
Name | Value | Default |
---|---|---|
defaultColor | srgbHex String | #fff |
width | number | 25 |
height | number | 25 |
Name | Value |
---|---|
colorPicked | srgbHex String |