Milano
Milano

Reputation: 18705

How to use Vue.js element without npm?

Is it possible to use a component without having npm?

I'm trying to make https://www.npmjs.com/package/vue-bootstrap4-table#4-basic-usage work but it fails.

I can't import component inside html file.

Tried:

import VueBootstrap4Table from 'vue-bootstrap4-table';

app = new Vue({
  el: '#app',
  data: {
    rows: [{

Here is the fiddle.

What is wrong with this code?

Upvotes: 0

Views: 199

Answers (1)

Kyle
Kyle

Reputation: 1503

remove:

import VueBootstrap4Table from 'vue-bootstrap4-table';

and

...,
components: {
  VueBootstrap4Table
}

from the bottom of your Vue instance - by adding the CDN reference, it's already included.

Then lastly, looks like you were missing the bootstrap css for this table. I added it as a dependency in the fiddle.

check it out:

https://jsfiddle.net/u4twL905/

Upvotes: 2

Related Questions