yairEO / tagify

🔖 lightweight, efficient Tags input component in Vanilla JS / React / Angular / Vue
https://yaireo.github.io/tagify/
Other
3.55k stars 436 forks source link

Vue file with compilation error #1378

Closed igmacedom closed 3 weeks ago

igmacedom commented 2 months ago

Prerequisites

💥 Demo Page

Does not apply. Error in NPM package using Vite packager

Explanation

Functional file

<template v-once>
  <textarea v-if="mode === 'textarea'" v-bind="value"/>
  <input v-else :value="value" v-on:change="onChange">
</template>

<script>
import Tagify from "./tagify.esm.js"
import "./tagify.css"

export default {
  name: "Tags",
  props: {
    mode: String,
    settings: Object,
    value: [String, Array],
    onChange: Function
  },
  watch: {
    value(newVal, oldVal) {
      this.tagify.loadOriginalValues(newVal)
    },
  },
  mounted() {
    this.tagify = new Tagify(this.$el, this.settings)
  }
};
</script>
ilogus commented 2 months ago

Same there using blade + vite with version : "@yaireo/tagify": "^4.27.0"

Error: Missing "./src/tagify" specifier in "@yaireo/tagify" package

Code used :

import Tagify from '@yaireo/tagify';

try {
  window.Tagify = Tagify;
} catch (e) {}

export { Tagify };

import in scss file :

@import '@yaireo/tagify/src/tagify';