vue-password-strength-meter icon indicating copy to clipboard operation
vue-password-strength-meter copied to clipboard

Support for typescript

Open Jamesvandenhoudt opened this issue 7 years ago • 3 comments
trafficstars

Can you add support for type definitions, please?

Jamesvandenhoudt avatar May 02 '18 09:05 Jamesvandenhoudt

Not really experienced in ts. So if anyone want to make a PR, feel free to do it :)

:v:

apertureless avatar Jul 18 '18 11:07 apertureless

Hi guys, made the component works with typescript just changing the import to:

import * as Password from 'vue-password-strength-meter'

Hope it helps, cheers.

carloca68 avatar Jul 25 '18 02:07 carloca68

Or create a file vue-password-strength-meter.d.t anywhere in your project with following line:

declare module 'vue-password-strength-meter';

And if you need to get it to work with Nuxt in `universal' mode

  1. Create a vue-password-strength-meter.ts file in the plugin directory
import Vue from 'vue'
import Password from 'vue-password-strength-meter'
Vue.use(Password)
  1. In the nuxt.config.js file
...
plugin: [
    { src: '~plugins/vue-password-strength-metter', ssr: false }
],
...
  1. In a template:
 <client-only>
      <password v-model="password" :strength-meter-only="true" />
 </client-only>

zecka avatar Aug 11 '20 18:08 zecka