How can I ship my vue npm library to support both Vue 2 and Vue 3,

Viewed 633

I created a Vue.js library that measures password strength. I created the bundle for NPM with this command:

ue-cli-service build --target lib --name passwordMeter src/password-meter.vue

It works great with Vue 2.x with no problem but I get this error in the console when I use it in Vue 3

Uncaught (in promise) TypeError: _vm._self is undefined

I didn't use any features of Vue 2 that are not supported with Vue 3

The library's GitHub page: https://github.com/miladd3/vue-simple-password-meter

Test with Vue 3: https://codesandbox.io/s/beautiful-sara-sfyqv?file=/src/components/HelloWorld.vue

0 Answers
Related