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
+5 -5
View File
@@ -60,9 +60,11 @@ export default createComponent({
}
};
const updateShow = (show: boolean) => emit('update:show', show);
const onClick = () => {
if (props.closeOnClick) {
emit('update:show', false);
updateShow(false);
}
};
@@ -70,8 +72,6 @@ export default createComponent({
clearTimeout(timer);
};
const toggle = (show: boolean) => emit('update:show', show);
const renderIcon = () => {
const { icon, type, iconPrefix, loadingType } = props;
const hasIcon = icon || type === 'success' || type === 'fail';
@@ -109,7 +109,7 @@ export default createComponent({
clearTimer();
if (props.show && props.duration > 0) {
timer = setTimeout(() => {
emit('update:show', false);
updateShow(false);
}, props.duration);
}
});
@@ -132,7 +132,7 @@ export default createComponent({
closeOnClickOverlay={props.closeOnClickOverlay}
onClick={onClick}
onClosed={clearTimer}
{...{ 'onUpdate:show': toggle }}
{...{ 'onUpdate:show': updateShow }}
>
{renderIcon()}
{renderMessage()}