sefianecho / alwan

A simple, lightweight, customizable, touch friendly color picker, written in vanilla javascript with zero dependencies.

Home Page:https://sefianecho.github.io/alwan/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error when pick color on 1.1.2 version plugin

smartfox87 opened this issue · comments

I have error on 1.1.2 version, but on 1.0.0 version haven't error
Videorecord of error

Component code:
[<script setup>
import Alwan from "alwan";
import "alwan/dist/css/alwan.min.css";
import { ref } from "vue";
import { tryOnMounted } from "@vueuse/core";

const emit = defineEmits(["change"]);

const pickerRef = ref(null);
let instance = null;

tryOnMounted(() => {
instance = new Alwan(pickerRef.value, {
format: "hex",
});

instance.on("change", (e) => {
const color = e.hex();
console.log("change event", e);
emit("change", color);
if (!instance.config.swatches.includes(color)) {
instance.addSwatch(color);
}
});
});
</script>

Select Color
]

My package.json:
{
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"devDependencies": {
"@nuxt/image-edge": "^1.0.0-27968280.9739e4d",
"@nuxtjs/i18n": "^8.0.0-beta.10",
"@nuxtjs/robots": "^3.0.0",
"@nuxtjs/strapi": "^1.6.3",
"@nuxtjs/tailwindcss": "^6.2.0",
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.48.1",
"@vue/eslint-config-standard": "^8.0.1",
"@vueuse/core": "^9.11.1",
"@vueuse/nuxt": "^9.10.0",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.7.0",
"eslint-plugin-nuxt": "^4.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.8.0",
"markdown-it-style": "^1.0.0",
"nuxt": "^3.3.3",
"prettier": "^2.7.1",
"prettier-plugin-tailwindcss": "^0.1.13",
"sass": "^1.56.1",
"tailwindcss": "^3.2.4",
"typescript": "^4.9.5",
"vite-plugin-eslint": "^1.8.1"
},
"dependencies": {
"@gtm-support/vue-gtm": "^2.0.0",
"@nuxt-modules/cache": "^0.1.0",
"@nuxtjs/sitemap": "^2.4.0",
"@pinia/nuxt": "^0.4.6",
"@sentry/tracing": "^7.20.0",
"@sentry/vue": "^7.30.0",
"@vee-validate/rules": "^4.7.3",
"@vueuse/components": "^9.10.0",
"alwan": "^1.1.2",
"axios": "^1.1.3",
"defu": "^6.1.0",
"markdown-it": "^13.0.1",
"pinia": "^2.0.27",
"swiper": "^8.4.7",
"typescript": "^4.9.5",
"v-click-outside": "^3.2.0",
"vee-validate": "^4.7.3",
"vue-gtag-next": "^1.14.0",
"vue-tel-input": "^6.0.5",
"yandex-metrika-module-nuxt3": "^1.4.8"
}
}

commented

Is there any error messages ?

there is not
screenshot

commented

I think I know the issue, I'll update the code very soon

version 1.2.0 solved problem, thanks