-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table inside component #22
Comments
You need to pass the table data to the direct parent component. Can't say for sure what you did wrong without seeing your code. |
@matfish2 Here's what my code looks like. Just the example code. ...
var VueTables = require('vue-tables');
...
Vue.use(VueTables.client, {
filterByColumn: true,
perPage: 25
});
...
Vue.component('some-component', {
data: {
tableData: [
{id:1, name:"John",age:"20"},
{id:2, name:"Jane",age:"24"},
{id:3, name:"Susan",age:"16"},
{id:4, name:"Chris",age:"55"},
{id:5, name:"Dan",age:"40"}
],
options: {
columns:['id','name','age']
}
}
});
... <some-component>
<v-client-table :data="tableData" :options="options"></v-client-table>
</some-component> The example on jsfiddle works. But as soon as i make it a component, it stops working. |
@matfish2 https://jsfiddle.net/57e0u3rm/ Reproduction of error. Am i doing something wrong here? |
To render the HTML you need to add
As a side note, component data should be returned from a function and not passed directly as an object:
|
Thanks. It Works. I did have |
It is working. You should replace |
How do i use it inside a component? Can't figure out a way.
I get the following error in my console:
At line 45 of lib/v-client-table.js
The text was updated successfully, but these errors were encountered: