vue2-simplert
vue2-simplert copied to clipboard
How to use Simplert with CDN
I I am trying to use by CDN, but i receive erro.
<script src="https://unpkg.com/[email protected]/dist/simplert.bundle.js"></script>
<script>
Vue.use(Simplert);
new Vue({
el: '#app',
mounted() {
let obj = {
title: 'Alert Title',
message: 'Alert Message',
type: 'info'
}
this.$refs.simplert.openSimplert(obj)
}
});
</script>
Error message in console
[Vue warn]: Error in mounted hook: "TypeError: Cannot read property 'openSimplert' of undefined"
You need to add <simplert :useRadius="false" :useIcon="false" ref="simplert"></simplert>
inside your app.
Check this: https://codepen.io/paulodiogo/pen/VOPjMN?editors=1010
why is it not working with CDN on 1.1.0? can you add global? example please.
Thank you