首页 > 解决方案 > 如何在 VueJS 中将完全编译的组件动态附加到 DOM

问题描述

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

标签: vue.js

解决方案


<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>

推荐阅读