perf: typography shaking when edit
parent
a61ec0a7c9
commit
275996e788
|
@ -1,5 +1,6 @@
|
|||
import type { CSSProperties, VNode } from 'vue';
|
||||
import {
|
||||
onMounted,
|
||||
getCurrentInstance,
|
||||
watch,
|
||||
onBeforeUnmount,
|
||||
|
@ -142,6 +143,11 @@ const ResizableTextArea = defineComponent({
|
|||
});
|
||||
},
|
||||
);
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
resizeTextarea();
|
||||
});
|
||||
});
|
||||
const instance = getCurrentInstance();
|
||||
expose({
|
||||
resizeTextarea,
|
||||
|
|
|
@ -85,6 +85,7 @@ export interface ShowCountProps {
|
|||
}
|
||||
const textAreaProps = {
|
||||
...omit(inputProps, ['prefix', 'addonBefore', 'addonAfter', 'suffix']),
|
||||
rows: Number,
|
||||
autosize: { type: [Boolean, Object] as PropType<AutoSizeType>, default: undefined },
|
||||
autoSize: { type: [Boolean, Object] as PropType<AutoSizeType>, default: undefined },
|
||||
onResize: { type: Function as PropType<(size: { width: number; height: number }) => void> },
|
||||
|
|
|
@ -122,6 +122,7 @@ const Editable = defineComponent({
|
|||
onCompositionstart={onCompositionStart}
|
||||
onCompositionend={onCompositionEnd}
|
||||
onBlur={onBlur}
|
||||
rows={1}
|
||||
autoSize={props.autoSize === undefined || props.autoSize}
|
||||
/>
|
||||
{slots.enterIcon ? (
|
||||
|
|
Loading…
Reference in New Issue