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