-1

我正在尝试制作弹出通知之类的东西。

  • 每个通知都将异步创建。(随机间隔)
  • 每个通知都是一个组件。Eg. <my-notification ... />
  • 主要组件<notification-manager />应该能够创建 N 个通知。
4

1 回答 1

1
<template>
    <my-notification v-for="notification in notifications" :notification="notification" />
</template>

<script>
export default {
    data(){
        notifications: []
    },
    async created() {
        var notification = await getNotificaiton();
        this.notifications.push(notification);   
        // Keep on pushing as you get
    }
}
</script>
于 2019-02-22T10:25:10.460 回答