Change vueVersion from 3 to 2 or 'auto' and restart sandbox.
Context (Environment)
Vite + Vue 2.x
Detailed Description
This behaviour is only reproducible with Vite and @vitejs/plugin-vue as the plugin does not have an internal dependency on 'vue-template-es2015-compiler' package.
Note, using @vue/cli does not cause this error.
Possible Implementation
I have two suggestion to solve it:
specify 'vue-template-es2015-compiler' package as required with Vue 2.x. Also we could manually check the package and throw an error inside src/core/generator.ts;
detect Vite as a separated environment and always use '@vue/compiler-sfc' package to compile template.
--
Let me know, if you need any additional information.
Hello, Thank you for you work on this repo. I've been using this plugin for a few week and I have ran into several small issues:
1. Vue 2.x event listeners bug
Expected Behavior
In the following example I expect
clickHandler
function to be called.Event binding should work with
v-on="..."
as well.Current Behavior
Not
clickHandler
function is being called, norv-on="..."
is working.Possible Solution
Adding
.native
modifier helps to archive the expected behaviour.However,
.native
cannot be used as permanent solution. I hoped we could addv-on="$listeners"
directly to SvgIcon component template.Steps to Reproduce
Context (Environment)
Vite + Vue 2.x
Detailed Description
The following issue is only reproducible with Vue 2.x and with Vue 3 the expected behaviour matches the current one, due to breaking changes.
Possible Implementation
Possible implementation would be to add v-on="$listeners" inside predefined Vue template in
scr/core/snippets.ts
:Please note, as we have different behaviour for 2.x and 3 we should make sure to apply
v-on="$listeners"
only for 2.x.2. Vite + Vue 2.x error
Expected Behavior
When plugin is mounted, it should create svg sprite:
Current Behavior
Vite throws an error:
Possible Solution
Set
vueVersion
manually to 3.Steps to Reproduce
Context (Environment)
Vite + Vue 2.x
Detailed Description
This behaviour is only reproducible with Vite and
@vitejs/plugin-vue
as the plugin does not have an internal dependency on 'vue-template-es2015-compiler' package. Note, using @vue/cli does not cause this error.Possible Implementation
I have two suggestion to solve it:
-- Let me know, if you need any additional information.