vueform / multiselect

Vue 3 multiselect component with single select, multiselect and tagging options (+Tailwind CSS support).
https://vueform.com
MIT License
808 stars 151 forks source link

Usage instructions for Vue 2.7 are inaccurate #294

Closed FichteFoll closed 1 year ago

FichteFoll commented 1 year ago

Version

Description

Trying to import import VueFormMultiselect from '@vueform/multiselect/multiselect.vue2.js' fails in both vite and webpack with an error message like follows:

[vite] Internal server error: Failed to resolve import "@vueform/multiselect/multiselect.vue2.js" from "src/components/TheWelcome.vue". Does the file exist?

It works if the dist folder is added inbetween, i.e.

import VueFormMultiselect from '@vueform/multiselect/dist/multiselect.vue2.js';

However, typescript then complains about not having any type declarations for this file, so you additionally need the following multiselect.d.ts:

declare module '@vueform/multiselect/dist/multiselect.vue2.js' {
    import Multiselect from '@vueform/multiselect';
    export default Multiselect;
}

Demo

I don't know how to set up a jsfiddle with this specific setup. My apologies.