mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-10 12:50:28 +08:00
fix(form): 修复text append按钮大小
This commit is contained in:
parent
9ae93fc9f2
commit
59c0a090b8
@ -14,6 +14,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
v-if="typeof config.append === 'object' && config.append.type === 'button'"
|
v-if="typeof config.append === 'object' && config.append.type === 'button'"
|
||||||
style="color: #409eff"
|
style="color: #409eff"
|
||||||
|
:size="size"
|
||||||
@click.prevent="buttonClickHandler"
|
@click.prevent="buttonClickHandler"
|
||||||
>
|
>
|
||||||
{{ config.append.text }}
|
{{ config.append.text }}
|
||||||
@ -43,6 +44,8 @@ export default defineComponent({
|
|||||||
emits: ['change', 'input'],
|
emits: ['change', 'input'],
|
||||||
|
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
|
const mForm = inject<FormState | undefined>('mForm');
|
||||||
|
|
||||||
useAddField(props.prop);
|
useAddField(props.prop);
|
||||||
|
|
||||||
const modelName = computed(() => props.name || props.config.name || '');
|
const modelName = computed(() => props.name || props.config.name || '');
|
||||||
@ -54,14 +57,11 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
inputHandler(v: string | number) {
|
inputHandler(v: string | number) {
|
||||||
const mForm = inject<FormState | undefined>('mForm');
|
|
||||||
emit('input', v);
|
emit('input', v);
|
||||||
mForm?.$emit('field-input', props.prop, v);
|
mForm?.$emit('field-input', props.prop, v);
|
||||||
},
|
},
|
||||||
|
|
||||||
buttonClickHandler() {
|
buttonClickHandler() {
|
||||||
const mForm = inject<FormState | undefined>('mForm');
|
|
||||||
|
|
||||||
if (typeof props.config.append === 'string') return;
|
if (typeof props.config.append === 'string') return;
|
||||||
|
|
||||||
if (props.config.append?.handler) {
|
if (props.config.append?.handler) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user