style: lint

pull/4134/head
tanjinzhou 2021-05-24 14:59:20 +08:00
parent 0c9951a0c1
commit 1139aa5f87
10 changed files with 25 additions and 30 deletions

View File

@ -62,21 +62,20 @@ const TransButton = defineComponent({
focus,
blur,
});
const { noStyle, disabled, ...restProps } = props;
let mergedStyle: CSSProperties = {};
if (!noStyle) {
mergedStyle = {
...inlineStyle,
};
}
if (disabled) {
mergedStyle.pointerEvents = 'none';
}
return () => {
const { noStyle, disabled, ...restProps } = props;
let mergedStyle: CSSProperties = {};
if (!noStyle) {
mergedStyle = {
...inlineStyle,
};
}
if (disabled) {
mergedStyle.pointerEvents = 'none';
}
return (
<div
role="button"

View File

@ -43,8 +43,8 @@ export type AvatarProps = Partial<ExtractPropTypes<typeof avatarProps>>;
const Avatar = defineComponent({
name: 'AAvatar',
props: avatarProps,
inheritAttrs: false,
props: avatarProps,
slots: ['icon'],
setup(props, { slots, attrs }) {
const isImgExist = ref(true);

View File

@ -29,8 +29,8 @@ export type AvatarGroupProps = Partial<ExtractPropTypes<typeof groupProps>> & {
const Group = defineComponent({
name: 'AAvatarGroup',
props: groupProps,
inheritAttrs: false,
props: groupProps,
setup(props, { slots, attrs }) {
const { prefixCls, direction } = useConfigInject('avatar-group', props);
useProvideSize<AvatarSize>(props);

View File

@ -130,7 +130,7 @@ const BackTop = defineComponent({
class: {
[`${prefixCls.value}`]: true,
[`${attrs.class}`]: attrs.class,
[`${prefixCls}-rtl`]: configProvider.direction === 'rtl',
[`${prefixCls.value}-rtl`]: configProvider.direction === 'rtl',
},
};

View File

@ -11,8 +11,8 @@ export type MenuItemGroupProps = Partial<ExtractPropTypes<typeof menuItemGroupPr
export default defineComponent({
name: 'AMenuItemGroup',
props: menuItemGroupProps,
inheritAttrs: false,
props: menuItemGroupProps,
slots: ['title'],
setup(props, { slots, attrs }) {
const { prefixCls } = useInjectMenu();

View File

@ -108,7 +108,7 @@ export default defineComponent({
store,
() => {
const newKeyMapStore = {};
for (let [_eventKey, menuInfo] of Object.entries(store)) {
for (const [, menuInfo] of Object.entries(store)) {
newKeyMapStore[menuInfo.key] = menuInfo;
}
keyMapStore.value = newKeyMapStore;
@ -308,10 +308,6 @@ export default defineComponent({
triggerSelection(info);
};
const onInternalKeyDown = (e: KeyboardEvent) => {
console.log('onInternalKeyDown', e);
};
const onInternalOpenChange = (eventKey: Key, open: boolean) => {
const { key, childrenEventKeys } = store[eventKey];
let newOpenKeys = mergedOpenKeys.value.filter(k => k !== key);
@ -369,7 +365,7 @@ export default defineComponent({
});
return () => {
return (
<ul class={className.value} tabindex="0" onKeydown={onInternalKeyDown}>
<ul class={className.value} tabindex="0">
{slots.default?.()}
</ul>
);

View File

@ -30,10 +30,10 @@ export type MenuItemProps = Partial<ExtractPropTypes<typeof menuItemProps>>;
export default defineComponent({
name: 'AMenuItem',
inheritAttrs: false,
props: menuItemProps,
emits: ['mouseenter', 'mouseleave', 'click', 'keydown', 'focus'],
slots: ['icon'],
inheritAttrs: false,
setup(props, { slots, emit, attrs }) {
const instance = getCurrentInstance();
const key = instance.vnode.key;
@ -95,8 +95,8 @@ export default defineComponent({
const getEventInfo = (e: MouseEvent | KeyboardEvent): MenuInfo => {
return {
key: key,
eventKey: eventKey,
key,
eventKey,
keyPath: keysPath.value,
eventKeyPath: [...parentEventKeys.value, eventKey],
domEvent: e,

View File

@ -14,6 +14,7 @@ const popupPlacementMap = {
};
export default defineComponent({
name: 'PopupTrigger',
inheritAttrs: false,
props: {
prefixCls: String,
mode: String as PropType<MenuMode>,
@ -26,7 +27,6 @@ export default defineComponent({
},
slots: ['popup'],
emits: ['visibleChange'],
inheritAttrs: false,
setup(props, { slots, emit }) {
const innerVisible = ref(false);
const {

View File

@ -35,10 +35,10 @@ export type SubMenuProps = Partial<ExtractPropTypes<typeof subMenuProps>>;
export default defineComponent({
name: 'ASubMenu',
inheritAttrs: false,
props: subMenuProps,
slots: ['icon', 'title'],
emits: ['titleClick', 'mouseenter', 'mouseleave'],
inheritAttrs: false,
setup(props, { slots, attrs, emit }) {
useProvideFirstLevel(false);

View File

@ -35,7 +35,7 @@ const switchProps = {
onClick: PropTypes.func,
onKeydown: PropTypes.func,
onMouseup: PropTypes.func,
'onUpdate:checked': PropTypes.func
'onUpdate:checked': PropTypes.func,
};
export type SwitchProps = Partial<ExtractPropTypes<typeof switchProps>>;