Open alireza0sfr opened 2 years ago
I have the same problem as you.
@rwerplus did you find anything solutions?
No! it seems that the author is busy with other work and has not been fixed yet. I plan to write in vue3 first.
that sucks mine is vue 3 compatible already but I want vue 2 compability too
that sucks mine is vue 3 compatible already but I want vue 2 compability too
yeah but compatibility with both V2 and V3 is cumbersome
On Vue-i18n documentation you can notice there is the compatibility range on both of the versions (8, 9) pointing respectively to Vue 2+ and Vue 3+
What you'd need eventually is to install both of the package, and depending on the current version of Vue, using one or another version of the i18n library. note that you'd need to use this method as the name conflicts: https://stackoverflow.com/a/56495895/8886385
You should be able to do something like:
import Vue2i18n from 'vue-i18n-old';
import { createI18n } from 'vue-i18n';
import { isVue2 } from 'vue-demi';
let i18n;
if (isVue2()) {
i18n = Vue2i18n
} else {
i18n = createI18n({
// something vue-i18n options here ...
})
}
export default i18n;
hey there, i have a vue3+vite package and i want to use it in vue2 aswell in vue 3 everything works like a charm but in vue 2 i get "createElementVNode is not a function" error
install.ts(entry):
vite.config.js:
package.json: