StrengthMeter

用于校验密码强度

Usage

<template>
  <div class="p-4 flex justify-center">
    <div class="demo-wrap p-10">
      <StrengthMeter placeholder="默认" />
      <StrengthMeter placeholder="禁用" disabled />
      <br />
      <StrengthMeter placeholder="隐藏input" :show-input="false" value="!@#qwe12345" />
    </div>
  </div>
</template>

<script lang="ts">
  import { defineComponent } from 'vue';
  import StrengthMeter from '/@/components/StrengthMeter/index';
  export default defineComponent({
    components: {
      StrengthMeter,
    },
  });
</script>
<style lang="less" scoped>
  .demo-wrap {
    width: 50%;
    background: #fff;
    border-radius: 10px;
  }
</style>

Props

属性类型默认值可选值说明
valuestring--校验的值
showInputbooleantrue-是否显示 input
disabledbooleanfalse-是否禁用

Events

事件回调参数说明
score-changenumber强度值改变触发
changestringinput 值改变触发