style: update

pull/4606/head
tangjinzhou 2021-08-26 15:44:27 +08:00
parent d72798bc08
commit 590522678a
2 changed files with 5 additions and 5 deletions

View File

@ -22,9 +22,9 @@ import {
} from './util'; } from './util';
import KeywordTrigger from './KeywordTrigger'; import KeywordTrigger from './KeywordTrigger';
import { vcMentionsProps, defaultProps } from './mentionsProps'; import { vcMentionsProps, defaultProps } from './mentionsProps';
import antInput from '../../_util/antInputDirective';
import type { OptionProps } from './Option'; import type { OptionProps } from './Option';
import MentionsContextKey from './MentionsContext'; import MentionsContextKey from './MentionsContext';
import antInputDirective from '../../_util/antInputDirective';
export type MentionsProps = Partial<ExtractPropTypes<typeof vcMentionsProps>>; export type MentionsProps = Partial<ExtractPropTypes<typeof vcMentionsProps>>;
@ -36,7 +36,7 @@ export default defineComponent({
props: initDefaultProps(vcMentionsProps, defaultProps), props: initDefaultProps(vcMentionsProps, defaultProps),
slots: ['notFoundContent', 'option'], slots: ['notFoundContent', 'option'],
emits: ['change', 'select', 'search', 'focus', 'blur', 'pressenter'], emits: ['change', 'select', 'search', 'focus', 'blur', 'pressenter'],
setup(props: MentionsProps, { emit, attrs, expose, slots }) { setup(props, { emit, attrs, expose, slots }) {
const measure = ref(null); const measure = ref(null);
const textarea = ref(null); const textarea = ref(null);
const focusId = ref(); const focusId = ref();
@ -114,7 +114,7 @@ export default defineComponent({
const { measureText: prevMeasureText, measuring } = state; const { measureText: prevMeasureText, measuring } = state;
const { prefix, validateSearch } = props; const { prefix, validateSearch } = props;
const target = event.target as HTMLTextAreaElement; const target = event.target as HTMLTextAreaElement;
if (target.composing) { if ((target as any).composing) {
return; return;
} }
const selectionStartText = getBeforeSelectionText(target); const selectionStartText = getBeforeSelectionText(target);
@ -277,7 +277,7 @@ export default defineComponent({
}; };
return ( return (
<div class={classNames(prefixCls, className)} style={style}> <div class={classNames(prefixCls, className)} style={style}>
{withDirectives(<textarea ref={textarea} {...textareaProps} />, [[antInput]])} {withDirectives(<textarea ref={textarea} {...textareaProps} />, [[antInputDirective]])}
{measuring && ( {measuring && (
<div ref={measure} class={`${prefixCls}-measure`}> <div ref={measure} class={`${prefixCls}-measure`}>
{state.value.slice(0, measureLocation)} {state.value.slice(0, measureLocation)}

View File

@ -1067,7 +1067,7 @@ export default function generateSelector<
menuItemSelectedIcon={menuItemSelectedIcon} menuItemSelectedIcon={menuItemSelectedIcon}
virtual={virtual !== false && dropdownMatchSelectWidth !== false} virtual={virtual !== false && dropdownMatchSelectWidth !== false}
onMouseenter={onPopupMouseEnter} onMouseenter={onPopupMouseEnter}
v-slots={{ ...slots, option: slots.option }} v-slots={slots}
/> />
); );