|
@@ -65,7 +65,7 @@ import { Notify } from './notify';
|
|
|
const { createDemo } = createComponent('notify');
|
|
const { createDemo } = createComponent('notify');
|
|
|
export default createDemo({
|
|
export default createDemo({
|
|
|
setup() {
|
|
setup() {
|
|
|
- const baseNotify = msg => {
|
|
|
|
|
|
|
+ const baseNotify = (msg: string) => {
|
|
|
Notify.text(msg, {
|
|
Notify.text(msg, {
|
|
|
onClose: () => {
|
|
onClose: () => {
|
|
|
console.log('close');
|
|
console.log('close');
|
|
@@ -75,22 +75,22 @@ export default createDemo({
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
- const primaryNotify = msg => {
|
|
|
|
|
|
|
+ const primaryNotify = (msg: string) => {
|
|
|
Notify.primary(msg);
|
|
Notify.primary(msg);
|
|
|
};
|
|
};
|
|
|
- const successNotify = msg => {
|
|
|
|
|
|
|
+ const successNotify = (msg: string) => {
|
|
|
Notify.success(msg);
|
|
Notify.success(msg);
|
|
|
};
|
|
};
|
|
|
- const errorNotify = msg => {
|
|
|
|
|
|
|
+ const errorNotify = (msg: string) => {
|
|
|
Notify.danger(msg);
|
|
Notify.danger(msg);
|
|
|
};
|
|
};
|
|
|
- const warningNotify = msg => {
|
|
|
|
|
|
|
+ const warningNotify = (msg: string) => {
|
|
|
Notify.warn(msg);
|
|
Notify.warn(msg);
|
|
|
};
|
|
};
|
|
|
- const cusBgNotify = msg => {
|
|
|
|
|
|
|
+ const cusBgNotify = (msg: string) => {
|
|
|
Notify.text(msg, { color: '#ad0000', background: '#ffe1e1' });
|
|
Notify.text(msg, { color: '#ad0000', background: '#ffe1e1' });
|
|
|
};
|
|
};
|
|
|
- const timeNotify = msg => {
|
|
|
|
|
|
|
+ const timeNotify = (msg: string) => {
|
|
|
Notify.text(msg, { duration: 10000 });
|
|
Notify.text(msg, { duration: 10000 });
|
|
|
};
|
|
};
|
|
|
return {
|
|
return {
|
|
@@ -106,7 +106,4 @@ export default createDemo({
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
|
|
-.nut-temp {
|
|
|
|
|
-}
|
|
|
|
|
-</style>
|
|
|
|
|
|
|
+<style lang="scss" scoped></style>
|