chore: improve notify document demo
This commit is contained in:
parent
ac8d638d0c
commit
40ed34a210
|
@ -20,7 +20,7 @@ export default defineComponent({
|
||||||
const classObject = {
|
const classObject = {
|
||||||
animated: showingToast.value,
|
animated: showingToast.value,
|
||||||
toast: true
|
toast: true
|
||||||
};
|
} as any;
|
||||||
classObject[props.animate] = false;
|
classObject[props.animate] = false;
|
||||||
classObject[animateEnd] = showingToast.value;
|
classObject[animateEnd] = showingToast.value;
|
||||||
classObject[toast.value.type] = true;
|
classObject[toast.value.type] = true;
|
||||||
|
@ -34,7 +34,7 @@ export default defineComponent({
|
||||||
const hasSpecialToastType = toast.value && toast.value.type;
|
const hasSpecialToastType = toast.value && toast.value.type;
|
||||||
const iconType = hasSpecialToastType ? toast.value.type.replace('toasty-type-', '') : 'default';
|
const iconType = hasSpecialToastType ? toast.value.type.replace('toasty-type-', '') : 'default';
|
||||||
const iconTypeName = `f-icon-${iconType}`;
|
const iconTypeName = `f-icon-${iconType}`;
|
||||||
const classObject = { 'f-icon': true };
|
const classObject = { 'f-icon': true } as any;
|
||||||
classObject[iconTypeName] = true;
|
classObject[iconTypeName] = true;
|
||||||
return classObject;
|
return classObject;
|
||||||
});
|
});
|
||||||
|
@ -60,7 +60,7 @@ export default defineComponent({
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onClickButton($event: Event, notifyButton: NotifyButton) {}
|
function onClickButton($event: Event, notifyButton: NotifyButton) { }
|
||||||
|
|
||||||
function getNotifyButtonClass(notifyButton: NotifyButton) {
|
function getNotifyButtonClass(notifyButton: NotifyButton) {
|
||||||
return `f-preten-link ${notifyButton.customClass ? notifyButton.customClass : ''}`;
|
return `f-preten-link ${notifyButton.customClass ? notifyButton.customClass : ''}`;
|
||||||
|
@ -95,7 +95,7 @@ export default defineComponent({
|
||||||
return (
|
return (
|
||||||
<div class={toastClass.value}>
|
<div class={toastClass.value}>
|
||||||
{shouldShowCloseButton.value && (
|
{shouldShowCloseButton.value && (
|
||||||
<button class="toast-close f-btn-icon f-bare" onClick={onCloseToast}>
|
<button title="close" class="toast-close f-btn-icon f-bare" onClick={onCloseToast}>
|
||||||
<span class="f-icon modal_close"></span>
|
<span class="f-icon modal_close"></span>
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -25,8 +25,8 @@ function showMessage() {
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
id: '1',
|
id: '1',
|
||||||
animate: 'fadeIn',
|
animate: 'fadeIn',
|
||||||
options: { type: 'string', title: 'string', msg: 'string' },
|
options: { type: 'string', title: 'This is a title', msg: 'This is some message' },
|
||||||
toasts: [{ type: 'string', title: 'string', msg: 'string' }]
|
toasts: [{ type: 'string', title: 'This is a title', msg: 'This is some message' }]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue