chore: rename variables and comments

This commit is contained in:
chenjiahan
2021-03-02 17:55:22 +08:00
parent a0addef294
commit 6e5329cbe0
50 changed files with 85 additions and 82 deletions
+6 -6
View File
@@ -13,7 +13,7 @@ import { Instance, createPopper, offsetModifier } from '@vant/popperjs';
import { ComponentInstance, createNamespace } from '../utils';
import { BORDER_BOTTOM } from '../utils/constant';
// Composition
// Composables
import { useClickAway } from '@vant/use';
// Components
@@ -125,11 +125,11 @@ export default createComponent({
});
};
const toggle = (value: boolean) => emit('update:show', value);
const updateShow = (value: boolean) => emit('update:show', value);
const onClickWrapper = () => {
if (props.trigger === 'click') {
toggle(!props.show);
updateShow(!props.show);
}
};
@@ -146,11 +146,11 @@ export default createComponent({
emit('select', action, index);
if (props.closeOnClickAction) {
toggle(false);
updateShow(false);
}
};
const onClickAway = () => toggle(false);
const onClickAway = () => updateShow(false);
const renderAction = (action: PopoverAction, index: number) => {
const { icon, text, color, disabled, className } = action;
@@ -194,7 +194,7 @@ export default createComponent({
transition="van-popover-zoom"
lockScroll={false}
onTouchstart={onTouchstart}
{...{ ...attrs, 'onUpdate:show': toggle }}
{...{ ...attrs, 'onUpdate:show': updateShow }}
>
<div class={bem('arrow')} />
<div role="menu" class={bem('content')}>