Update form-input.vue
This commit is contained in:
parent
e7fb2b7ae8
commit
69d1d54668
@ -34,6 +34,10 @@ const props = defineProps({
|
|||||||
title: {
|
title: {
|
||||||
default: ''
|
default: ''
|
||||||
},
|
},
|
||||||
|
placeholder: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
disableChange: {
|
disableChange: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
@ -44,7 +48,12 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const placeholder = computed(() => `请输入${props.name || ''}`)
|
const placeholder = computed(() => {
|
||||||
|
if (typeof props.placeholder === 'string' && props.placeholder.trim()) {
|
||||||
|
return props.placeholder.trim()
|
||||||
|
}
|
||||||
|
return `请输入${props.name || ''}`
|
||||||
|
})
|
||||||
const value = computed(() => props.form && props.form && props.form[props.title] ? props.form[props.title] : '')
|
const value = computed(() => props.form && props.form && props.form[props.title] ? props.form[props.title] : '')
|
||||||
|
|
||||||
function change(e) {
|
function change(e) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user