chore: rename variables and comments
This commit is contained in:
+5
-5
@@ -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()}
|
||||
|
||||
Reference in New Issue
Block a user