How can I use the Toast service via CDN? #154
Answered
by
tugcekucukoglu
selcukkutuk
asked this question in
PrimeVue
-
Hello, JS Side: const { createApp, ref, computed, onMounted, onUnmounted } = Vue;
const { useToast } = primevue.usetoast;
createApp({
setup() {
const toast = useToast();
function showToast() {
toast.add({ severity: 'info', summary: 'Info Message', detail: 'Message Content', life: 3000 });
}
return {
showToast
};
},
components: {
"p-toast": primevue.toast
},
})
.use(primevue.config.default)
.use(primevue.toastservice)
.mount("#app"); HTML Side: <div id="app">
<p-toast position="bottom-right"></p-toast>
<button type="button" v-on:click="showToast">Show Toast</button>
</div>
<script type="text/javascript" src="/lib/primevue/core/core.min.js"></script>
<script type="text/javascript" src="/lib/primevue/toast/toast.min.js"></script>
<script type="text/javascript" src="/lib/primevue/toasteventbus/toasteventbus.min.js"></script>
<script type="text/javascript" src="/lib/primevue/usetoast/usetoast.min.js"></script>
<script type="text/javascript" src="/lib/primevue/toastservice/toastservice.min.js"></script> |
Beta Was this translation helpful? Give feedback.
Answered by
tugcekucukoglu
Oct 2, 2023
Replies: 1 comment
-
Hello, HTML side needs an update:
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tugcekucukoglu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
HTML side needs an update: