-
-
Notifications
You must be signed in to change notification settings - Fork 94
Please add disable and destroy methods #180
-
I use your picker in Vue app and need to be able to destroy picker instance when my component with this picker is unmounted/ And I need to disable and enable picker, that means to prevent and pass user interactions with picker.
Thanx.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 3
Replies: 1 comment
-
I made a little npm-package with which you can use iro as a composeable.
It also has a disable functionality, which is a little hack, to be honest.
I achieved this by resetting the color every time the "input:change" event fires.
I didn't tested if you need to manually destroy anything because vue should do that automatically.
To use my module just type:
npm i v-iro.js
and import it into your component by:
import { useIroColorPicker } from "v-iro.js"
and then you can already use it:
const wrapper: Ref<HTMLElement> = ref()
const color = ref("")
const disable = ref(false)
const options = {
width: 130
}
useIroColorPicker(wrapper, options, disable).then((colorPicker) => {
colorPicker.on("color:change", (pickerColor: IroColor) => {
color.value = pickerColor.hexString
})
})
Beta Was this translation helpful? Give feedback.