<script setup lang="ts">
const props = defineProps(['propName', 'placeholder']);
const phone = defineModel('phone')
// defineProps({
//   placeholder: {
//     type: String,
//     default: '请输入用户名称/手机号'
//   }
// })

</script>

<template>
  <el-form-item :prop="props.propName" :rules="[
       { required: true, message: '请输入你的用户名称/手机号'},
      //  { pattern: /^1([345789])\d{9}$/, message: '请输入正确的手机号' }
      ]">
    <el-input v-model.number="phone" clearable  :placeholder="placeholder || '请输入用户名称/手机号'"/>
    <!-- <el-input v-model.number="phone"  minlength="11"  oninput="this.value = this.value.replace(/[^0-9]/g, '')" clearable maxlength="11" :placeholder="placeholder || '请输入用户名称/手机号'"/> -->
  </el-form-item>
</template>

<style scoped lang="scss">

</style>
