perf: typography shaking when edit

feat-css-var
tangjinzhou 2022-03-11 17:01:56 +08:00
parent a61ec0a7c9
commit 275996e788
3 changed files with 8 additions and 0 deletions

View File

@ -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,

View File

@ -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> },

View File

@ -122,6 +122,7 @@ const Editable = defineComponent({
onCompositionstart={onCompositionStart}
onCompositionend={onCompositionEnd}
onBlur={onBlur}
rows={1}
autoSize={props.autoSize === undefined || props.autoSize}
/>
{slots.enterIcon ? (