Initial vue 3 support, resolves #440 #587
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi everybody,
Hi @kaskar2008,
I finally decided to share my Vue 3 rewrite of the vue-simple-suggest library. Took me some time to achieve, and there are still some things to do (see below).
What works
npm run dev
. You can launch and test same demo as the one found at https://kazanexpress.github.io/vue-simple-suggest/What still needs to be done
npm run build
: it compiles "something", but it's probably wrong as-is.For now, I simply updated all the webpack + rollup dependencies to support Vue 3, but it all looks like clumsy and incomplete.
The dist/ directory has been updated but the contents of the generated files may be incorrect (not tested yet).
Some project files (like lib/window.js) are obsolete now.
Probably the best solution would be to migrate all the build process to use Vite + rollup. Some help here would be more than welcome.
Breaking changes
For a custom input component, bind the slot prop "componentField":
or
For a native html input, bind the slot prop "field":
or
This behavior is inspired by the way the vee-validate library makes its Field component work with Vue 3 (see doc) and avoids to hack the internal properties of the Vue VNodes to bind some listeners to them (anyway the Vue 3 VNode API doesn't allow such things anymore).
v-model
or@update:modelValue
and when setting the "emit" property to "select", usev-model:modelSelect
or@update:modelSelect
@select
event was kept for backward compatibility, but the@update:modelSelect
event should be used nowFor those who can't wait to try my Vue 3's implementation of the vue-simple-suggest library, you can simply take
lib/vue-simple-suggest.vue
andlib/misc.js
and put them directly in your own projects ;)Hope my patch will be useful ;)
Thierry.
PR updates:
This PR also includes fix #589 and #590, but not fix #588 (I'm not sure if it's still needed with Vue 3, that needs more testing).