style: lint
parent
0c9951a0c1
commit
1139aa5f87
|
@ -62,6 +62,7 @@ const TransButton = defineComponent({
|
||||||
focus,
|
focus,
|
||||||
blur,
|
blur,
|
||||||
});
|
});
|
||||||
|
return () => {
|
||||||
const { noStyle, disabled, ...restProps } = props;
|
const { noStyle, disabled, ...restProps } = props;
|
||||||
|
|
||||||
let mergedStyle: CSSProperties = {};
|
let mergedStyle: CSSProperties = {};
|
||||||
|
@ -75,8 +76,6 @@ const TransButton = defineComponent({
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
mergedStyle.pointerEvents = 'none';
|
mergedStyle.pointerEvents = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
return () => {
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
role="button"
|
role="button"
|
||||||
|
|
|
@ -43,8 +43,8 @@ export type AvatarProps = Partial<ExtractPropTypes<typeof avatarProps>>;
|
||||||
|
|
||||||
const Avatar = defineComponent({
|
const Avatar = defineComponent({
|
||||||
name: 'AAvatar',
|
name: 'AAvatar',
|
||||||
props: avatarProps,
|
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
|
props: avatarProps,
|
||||||
slots: ['icon'],
|
slots: ['icon'],
|
||||||
setup(props, { slots, attrs }) {
|
setup(props, { slots, attrs }) {
|
||||||
const isImgExist = ref(true);
|
const isImgExist = ref(true);
|
||||||
|
|
|
@ -29,8 +29,8 @@ export type AvatarGroupProps = Partial<ExtractPropTypes<typeof groupProps>> & {
|
||||||
|
|
||||||
const Group = defineComponent({
|
const Group = defineComponent({
|
||||||
name: 'AAvatarGroup',
|
name: 'AAvatarGroup',
|
||||||
props: groupProps,
|
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
|
props: groupProps,
|
||||||
setup(props, { slots, attrs }) {
|
setup(props, { slots, attrs }) {
|
||||||
const { prefixCls, direction } = useConfigInject('avatar-group', props);
|
const { prefixCls, direction } = useConfigInject('avatar-group', props);
|
||||||
useProvideSize<AvatarSize>(props);
|
useProvideSize<AvatarSize>(props);
|
||||||
|
|
|
@ -130,7 +130,7 @@ const BackTop = defineComponent({
|
||||||
class: {
|
class: {
|
||||||
[`${prefixCls.value}`]: true,
|
[`${prefixCls.value}`]: true,
|
||||||
[`${attrs.class}`]: attrs.class,
|
[`${attrs.class}`]: attrs.class,
|
||||||
[`${prefixCls}-rtl`]: configProvider.direction === 'rtl',
|
[`${prefixCls.value}-rtl`]: configProvider.direction === 'rtl',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@ export type MenuItemGroupProps = Partial<ExtractPropTypes<typeof menuItemGroupPr
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'AMenuItemGroup',
|
name: 'AMenuItemGroup',
|
||||||
props: menuItemGroupProps,
|
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
|
props: menuItemGroupProps,
|
||||||
slots: ['title'],
|
slots: ['title'],
|
||||||
setup(props, { slots, attrs }) {
|
setup(props, { slots, attrs }) {
|
||||||
const { prefixCls } = useInjectMenu();
|
const { prefixCls } = useInjectMenu();
|
||||||
|
|
|
@ -108,7 +108,7 @@ export default defineComponent({
|
||||||
store,
|
store,
|
||||||
() => {
|
() => {
|
||||||
const newKeyMapStore = {};
|
const newKeyMapStore = {};
|
||||||
for (let [_eventKey, menuInfo] of Object.entries(store)) {
|
for (const [, menuInfo] of Object.entries(store)) {
|
||||||
newKeyMapStore[menuInfo.key] = menuInfo;
|
newKeyMapStore[menuInfo.key] = menuInfo;
|
||||||
}
|
}
|
||||||
keyMapStore.value = newKeyMapStore;
|
keyMapStore.value = newKeyMapStore;
|
||||||
|
@ -308,10 +308,6 @@ export default defineComponent({
|
||||||
triggerSelection(info);
|
triggerSelection(info);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onInternalKeyDown = (e: KeyboardEvent) => {
|
|
||||||
console.log('onInternalKeyDown', e);
|
|
||||||
};
|
|
||||||
|
|
||||||
const onInternalOpenChange = (eventKey: Key, open: boolean) => {
|
const onInternalOpenChange = (eventKey: Key, open: boolean) => {
|
||||||
const { key, childrenEventKeys } = store[eventKey];
|
const { key, childrenEventKeys } = store[eventKey];
|
||||||
let newOpenKeys = mergedOpenKeys.value.filter(k => k !== key);
|
let newOpenKeys = mergedOpenKeys.value.filter(k => k !== key);
|
||||||
|
@ -369,7 +365,7 @@ export default defineComponent({
|
||||||
});
|
});
|
||||||
return () => {
|
return () => {
|
||||||
return (
|
return (
|
||||||
<ul class={className.value} tabindex="0" onKeydown={onInternalKeyDown}>
|
<ul class={className.value} tabindex="0">
|
||||||
{slots.default?.()}
|
{slots.default?.()}
|
||||||
</ul>
|
</ul>
|
||||||
);
|
);
|
||||||
|
|
|
@ -30,10 +30,10 @@ export type MenuItemProps = Partial<ExtractPropTypes<typeof menuItemProps>>;
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'AMenuItem',
|
name: 'AMenuItem',
|
||||||
|
inheritAttrs: false,
|
||||||
props: menuItemProps,
|
props: menuItemProps,
|
||||||
emits: ['mouseenter', 'mouseleave', 'click', 'keydown', 'focus'],
|
emits: ['mouseenter', 'mouseleave', 'click', 'keydown', 'focus'],
|
||||||
slots: ['icon'],
|
slots: ['icon'],
|
||||||
inheritAttrs: false,
|
|
||||||
setup(props, { slots, emit, attrs }) {
|
setup(props, { slots, emit, attrs }) {
|
||||||
const instance = getCurrentInstance();
|
const instance = getCurrentInstance();
|
||||||
const key = instance.vnode.key;
|
const key = instance.vnode.key;
|
||||||
|
@ -95,8 +95,8 @@ export default defineComponent({
|
||||||
|
|
||||||
const getEventInfo = (e: MouseEvent | KeyboardEvent): MenuInfo => {
|
const getEventInfo = (e: MouseEvent | KeyboardEvent): MenuInfo => {
|
||||||
return {
|
return {
|
||||||
key: key,
|
key,
|
||||||
eventKey: eventKey,
|
eventKey,
|
||||||
keyPath: keysPath.value,
|
keyPath: keysPath.value,
|
||||||
eventKeyPath: [...parentEventKeys.value, eventKey],
|
eventKeyPath: [...parentEventKeys.value, eventKey],
|
||||||
domEvent: e,
|
domEvent: e,
|
||||||
|
|
|
@ -14,6 +14,7 @@ const popupPlacementMap = {
|
||||||
};
|
};
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'PopupTrigger',
|
name: 'PopupTrigger',
|
||||||
|
inheritAttrs: false,
|
||||||
props: {
|
props: {
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
mode: String as PropType<MenuMode>,
|
mode: String as PropType<MenuMode>,
|
||||||
|
@ -26,7 +27,6 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
slots: ['popup'],
|
slots: ['popup'],
|
||||||
emits: ['visibleChange'],
|
emits: ['visibleChange'],
|
||||||
inheritAttrs: false,
|
|
||||||
setup(props, { slots, emit }) {
|
setup(props, { slots, emit }) {
|
||||||
const innerVisible = ref(false);
|
const innerVisible = ref(false);
|
||||||
const {
|
const {
|
||||||
|
|
|
@ -35,10 +35,10 @@ export type SubMenuProps = Partial<ExtractPropTypes<typeof subMenuProps>>;
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ASubMenu',
|
name: 'ASubMenu',
|
||||||
|
inheritAttrs: false,
|
||||||
props: subMenuProps,
|
props: subMenuProps,
|
||||||
slots: ['icon', 'title'],
|
slots: ['icon', 'title'],
|
||||||
emits: ['titleClick', 'mouseenter', 'mouseleave'],
|
emits: ['titleClick', 'mouseenter', 'mouseleave'],
|
||||||
inheritAttrs: false,
|
|
||||||
setup(props, { slots, attrs, emit }) {
|
setup(props, { slots, attrs, emit }) {
|
||||||
useProvideFirstLevel(false);
|
useProvideFirstLevel(false);
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ const switchProps = {
|
||||||
onClick: PropTypes.func,
|
onClick: PropTypes.func,
|
||||||
onKeydown: PropTypes.func,
|
onKeydown: PropTypes.func,
|
||||||
onMouseup: PropTypes.func,
|
onMouseup: PropTypes.func,
|
||||||
'onUpdate:checked': PropTypes.func
|
'onUpdate:checked': PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
export type SwitchProps = Partial<ExtractPropTypes<typeof switchProps>>;
|
export type SwitchProps = Partial<ExtractPropTypes<typeof switchProps>>;
|
||||||
|
|
Loading…
Reference in New Issue