Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Please add disable and destroy methods #180

ConsMe started this conversation in Feature Requests
Discussion options

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.

You must be logged in to vote

Replies: 1 comment

Comment options

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
 })
})
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Converted from issue

This discussion was converted from issue #157 on April 05, 2021 21:30.

AltStyle によって変換されたページ (->オリジナル) /