Skip to content

Commit

Permalink
fix(form): 修复text append按钮大小
Browse files Browse the repository at this point in the history
  • Loading branch information
roymondchen authored and jia000 committed Apr 13, 2022
1 parent 9ae93fc commit 59c0a09
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/form/src/fields/Text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<el-button
v-if="typeof config.append === 'object' && config.append.type === 'button'"
style="color: #409eff"
:size="size"
@click.prevent="buttonClickHandler"
>
{{ config.append.text }}
Expand Down Expand Up @@ -43,6 +44,8 @@ export default defineComponent({
emits: ['change', 'input'],
setup(props, { emit }) {
const mForm = inject<FormState | undefined>('mForm');
useAddField(props.prop);
const modelName = computed(() => props.name || props.config.name || '');
Expand All @@ -54,14 +57,11 @@ export default defineComponent({
},
inputHandler(v: string | number) {
const mForm = inject<FormState | undefined>('mForm');
emit('input', v);
mForm?.$emit('field-input', props.prop, v);
},
buttonClickHandler() {
const mForm = inject<FormState | undefined>('mForm');
if (typeof props.config.append === 'string') return;
if (props.config.append?.handler) {
Expand Down

0 comments on commit 59c0a09

Please sign in to comment.