<template>
    <van-field
      :value="pwd"
      @input="input"
      :type="isShowPwd? 'text': 'password'"
      placeholder="请输入密码"
      label-align="right"
    >
      <template #button>
        <common-svg
          :name="!isShowPwd? 'yincang': 'xianshibeifen'"
          style="margin:5px;"
          @click.native="isShowPwd = !isShowPwd">
        </common-svg>
      </template>
    </van-field>
</template>
<script lang="ts">
import { Component, Vue, Model, Emit } from 'vue-property-decorator';
import { isCode, isEmail } from '@/const/pattern';
/**
 * 密码输入框
 */
@Component({
  name: 'PasswordInput',
})
export default class PasswordInput extends Vue {
  @Model ('input', { type: String, required: true })
  private readonly pwd!: string;
  private isShowPwd: boolean = false;

  @Emit('input')
  private input(e: string) {
    return e;
  }
}
</script>
<style scoped lang="scss">
</style>