ratiw / vue-table

data table simplify! -- vuetable is a Vue.js component that will automatically request (JSON) data from the server and display them nicely in html table with swappable/extensible pagination component.
MIT License
1.83k stars 303 forks source link

how to use vue table #107

Closed AnguruMona closed 8 years ago

AnguruMona commented 8 years ago

I gone through documentation and tried to use ratiw/vue-table , everytime failed from last three days.can u guide me how i will use vue-table on npm.

ratiw commented 8 years ago

@AnguruMona Look into the example first and state your problem clearly. It's just another NPM package, If you're not familiar with NPM, try the javascript version as in the example first.

AnguruMona commented 8 years ago

i used command npm install vuetable

this is my main.js

import Router from 'vue-router' import Resource from 'vue-resource' import VueFilter from 'vue-filter' import vuetable from 'vuetable' import VuetablePagination from 'VuetablePagination' import VuetablePaginationDropdown from 'VuetablePaginationDropdown' import App from './App.vue' import tabledata from './components/table.vue' var Vue = require('vue');

Vue.use(vuetable) Vue.use(Router) Vue.use(Resource) Vue.use(VueFilter) Vue.use(VuetablePaginationDropdown) Vue.use(VuetablePagination)

// routing var router = new Router() router.map({ '/commitDetails':{

component:tabledata }

}) router.start(App, '#app')

and this is my template

data is not displaying and getting warning message : 1.The "data" option should be a function that returns a per-instance value in component definitions

  1. Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

can u tell where i did mistake ?

ratiw commented 8 years ago

@AnguruMona 'vuetableis not a plugin, you don't have toVue.use(...)` it.

When using npm, you should import from src/components directory, like so.

import vuetable from 'vuetable/src/components/Vuetable.vue'
import VuetablePagination from 'vuetable/src/components/VuetablePagination.vue'
import VuetablePaginationDropdown from 'vuetable/src/components/VuetablePaginationDropdown.vue'
AnguruMona commented 8 years ago

First of Thank U so Much. Can u have look this file. Pls tell me if i did any mistake Vue.zip

warning message: 1.vue.common.js?e881:1019 [Vue warn]: The "el" option should be a function that returns a per-instance value in component definitions. 2.vue.common.js?e881:1019 [Vue warn]: The "data" option should be a function that returns a per-instance value in component definitions. 3.vue.common.js?e881:1019 [Vue warn]: Invalid prop: type check failed for prop "fields". Expected Array, got Undefined. (found in component: ) 4.Vuetable.vue?4974:377 Uncaught TypeError: Cannot read property 'forEach' of undefined

ratiw commented 8 years ago

@AnguruMona Sorry, you should put it in github. I would look into the source code, when I have time.

But it looks like you're using Vue 2.0, aren't you? If so, this version is not compatible with Vue 2.0.

AnguruMona commented 8 years ago

I am using Vue 2.4.0 .is it compatible or not

ratiw commented 8 years ago

@AnguruMona Nope, it's only working with Vue 1.x.

vuetable 2 will be released after the stable version of Vue 2.0 is released.

AnguruMona commented 8 years ago

Thank u so much