iview/examples/routers/notice.vue

49 lines
1.8 KiB
Vue
Raw Normal View History

<template>
2019-09-06 15:32:44 +08:00
<div>
<p>With desc</p>
<Button @click="info(false)">Info</Button>
<Button @click="success(false)">Success</Button>
<Button @click="warning(false)">Warning</Button>
<Button @click="error(false)">Error</Button>
<p>Only title</p>
<Button @click="info(true)">Info</Button>
<Button @click="success(true)">Success</Button>
<Button @click="warning(true)">Warning</Button>
<Button @click="error(true)">Error</Button>
</div>
</template>
<script>
export default {
2019-09-06 15:32:44 +08:00
methods: {
info (nodesc) {
this.$Notice.info({
2020-09-03 15:53:31 +08:00
duration: 10000,
2019-09-06 15:32:44 +08:00
title: 'Notification title',
desc: nodesc ? '' : 'Here is the notification description. Here is the notification description. '
});
},
success (nodesc) {
this.$Notice.success({
2020-09-03 15:53:31 +08:00
duration: 10000,
2019-09-06 15:32:44 +08:00
title: 'Notification title',
desc: nodesc ? '' : 'Here is the notification description. Here is the notification description. '
});
},
warning (nodesc) {
this.$Notice.warning({
2020-09-03 15:53:31 +08:00
duration: 10000,
2019-09-06 15:32:44 +08:00
title: 'Notification title',
desc: nodesc ? '' : 'Here is the notification description. Here is the notification description. '
});
},
error (nodesc) {
this.$Notice.error({
2020-09-03 15:53:31 +08:00
duration: 10000,
2019-09-06 15:32:44 +08:00
title: 'Notification title',
desc: nodesc ? '' : 'Here is the notification description. Here is the notification description. '
});
}
}
}
</script>