Files
sgxt_web/src/components/MyComponents/Other/index.vue

32 lines
694 B
Vue
Raw Normal View History

2025-04-12 14:54:02 +08:00
<template>
<div class="form-item-box" :style="{ width: width }">
<el-input :placeholder="placeholder" v-bind="$attrs" v-model="modelValue" @input="onInput" ></el-input>
</div>
</template>
<script setup>
import { COMPONENT_WIDTH } from "@/constant";
import { ref, defineProps, defineEmits, defineExpose } from "vue";
const props = defineProps({
//获取组件传值
placeholder: {
default: "请填写手机号",
type: String
},
modelValue: {
default: "",
type: String
},
width: {
default: COMPONENT_WIDTH,
type: String
}
});
const emits = defineEmits(["update:modelValue"]);
const onInput = (e) => {
emits("update:modelValue", e);
};
</script>