Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue3 support #54

Open
MINDoSOFT opened this issue Jan 9, 2021 · 0 comments
Open

Vue3 support #54

MINDoSOFT opened this issue Jan 9, 2021 · 0 comments

Comments

@MINDoSOFT
Copy link

Hi there !

Thank you for this awesome library.

I tried to use it in a Vue3 project and it didn't work. The password value seems to keep only one character.

After investigating a bit I found these references about breaking changes in Vue3

If anyone else is trying to make this component compatible with Vue3 you need to make the following changes in src/components/PasswordStrengthMeter.vue

line 14:

        :value="modelValue"

line 62:

     emits: ['input', 'blur', 'focus', 'score', 'hide', 'show', 'update:modelValue', 'feedback'],

line 68:

      modelValue: {
        type: String
      },

line 232:

      emitValue (type, value) {
        if (type == 'input') {
          this.$emit('update:modelValue', value) // Changed in Vue 3
        }
        else {
          this.$emit(type, value)
        }
        this.password = value
      }

line 294:

    watch: {
      modelValue (newValue) {

This makes it work on my environment with vue@3.0.5 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant