mrr.sj.front/components/dynamic-form/FormItemText.vue

40 lines
740 B
Vue
Raw Normal View History

2026-06-09 17:49:15 +08:00
<template>
2026-06-10 10:15:10 +08:00
<view class="form-text-wrap">
<input type="text" :value="value" :placeholder="placeholder" placeholder-class="placeholder" class="form-input" @input="onInput" />
</view>
2026-06-09 17:49:15 +08:00
</template>
<script>
export default {
2026-06-10 10:15:10 +08:00
name: 'FormItemText',
props: {
value: { type: [String, Number], default: '' },
placeholder: { type: String, default: '请输入' }
},
methods: {
onInput: function(e) {
this.$emit('input', e.target.value);
}
}
2026-06-09 17:49:15 +08:00
};
</script>
<style scoped>
2026-06-10 10:15:10 +08:00
.form-text-wrap {
flex: 1;
display: flex;
align-items: center;
}
2026-06-09 17:49:15 +08:00
.form-input {
2026-06-10 10:15:10 +08:00
flex: 1;
font-size: 28rpx;
color: #333333;
text-align: center;
2026-06-09 17:49:15 +08:00
}
.placeholder {
2026-06-10 10:15:10 +08:00
font-weight: 400;
font-size: 28rpx;
color: #999999;
2026-06-09 17:49:15 +08:00
}
</style>