231412 412389421
231412 412389421

Reputation: 313

How to use component without npm. I use Vue from CDN

I want to use vue-good-table but I use Vue from CDN so I can't do this like it's described in the documentation. I probably can import this library using:

https://unpkg.com/[email protected]/dist/vue-good-table.cjs.js

but how to load this component in

new Vue({
  delimiters: ['[[', ']]'],
  el: '#my-table',
  ....

?

Upvotes: 1

Views: 713

Answers (2)

nburkley
nburkley

Reputation: 165

To use vue-good-table in this way, you can reference it using

window['vue-good-table'].VueGoodTable

For example:

new Vue({
  delimiters: ['[[', ']]'],
  el: '#my-table',
  components: {
    VueGoodTable: window['vue-good-table'].VueGoodTable
  },
  ....

Upvotes: 0

bernie
bernie

Reputation: 10380

I didn't try this, but have you looked at adding a script tag with dist/vue-good-table.js ? Then I would expect you need to do this:

Vue.use(VueGoodTablePlugin);

like any other Vue plugin.

Upvotes: 1

Related Questions