vue2-simplert icon indicating copy to clipboard operation
vue2-simplert copied to clipboard

How to use Simplert with CDN

Open Laranjeiras opened this issue 5 years ago • 2 comments

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"

Laranjeiras avatar Mar 09 '19 00:03 Laranjeiras

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

paulodiogo avatar May 14 '19 23:05 paulodiogo

why is it not working with CDN on 1.1.0? can you add global? example please.

Thank you

amchconsult avatar Aug 04 '20 18:08 amchconsult