<template>
    <van-field 
      :value="email"
      @input="input"
      placeholder="邮箱"
      label-align="right"
      :disabled="!canEditEmail"
      clearable
    />
</template>
<script lang="ts">
import { Component, Vue, Model, Emit, Prop } from 'vue-property-decorator';
import { Field } from 'vant';
import { isPhone } from '@/const/pattern';
/**
 * 手机号输入框
 */
@Component({
  name: 'EmailInput',
  components: {
    [Field.name]: Field,
  },
})
export default class EmailInput extends Vue {
  @Model ('input', { type: String, required: true })
  private readonly email!: string;
  @Prop({ type: Boolean, default: true})
  private readonly canEditEmail!: boolean;

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