matfish2 / vue-tables

Vue.js grid components
https://www.npmjs.com/package/vue-tables
MIT License
357 stars 76 forks source link

Unknown custom element: <v-server-table> - did you register the component correctly? #140

Closed zeeshanyshaikh closed 7 years ago

zeeshanyshaikh commented 7 years ago

14

[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option. (found in ) warn @ app.js:sourcemap:1984 20:37:58.708

resources/assets/js/app.js


window.Vue = require('vue');
import {ServerTable, ClientTable, Event} from 'vue-tables-2';

Vue.use(ServerTable, {}, false, require('../vuetable/compiled/v-server-table.js')('server'));

I have copied the "complied" folder and placed in my resource/assets directory under folder "vuetable"
i tried both lines of code, but both failed
> Vue.use(ServerTable, {}, false, require('../vuetable/compiled/v-server-table.js')('server'));

>Vue.use(ServerTable, {}, false, require('../vuetable/compiled/template.js')('server'));

> index.blade.php
```html
<div class="box-body">
    <v-server-table url="{{ route('users.data') }}" :columns="columns" :options="options" name='serverTable'></v-server-table>
</div>
k4ffee commented 7 years ago

Because you referenced VueJS 2 in your bugreport, there is a VueJS 2 variant of vue-tables, https://github.com/matfish2/vue-tables-2/ . Did you tried that package?

zeeshanyshaikh commented 7 years ago

Actually, i am trying in vue-table-2 but mistakenly raised in vue-tables project.

zeeshanyshaikh commented 7 years ago

Issue raised in correct project. (https://github.com/matfish2/vue-tables-2/issues/299)

mateombar commented 5 years ago

If you dont wanna use the npm way: CDN: https://cdn.jsdelivr.net/npm/vue-tables-2@1.5.44/dist/vue-tables-2.min.js Just put it in the index.html with a script tag. Then in the app.js write: Vue.use(VueTables.ClientTable); and you can use this tutorial for support yourself https://edwardize.blogspot.com/2018/05/table-display-in-vuejs-vue-tables-2.html or whatever you want ;)