Vuejs with Vuetable2

Asked

Viewed 133 times

2

I’m trying to use the Vuetable-2 sending the information via props data. I searched several sites, tested and nothing worked, including found this example in the format I need, but it doesn’t work either. The most basic code, would be the code below, does anyone happen to know why this doesn’t work? Or the right way.

I put to display on the screen the test object that the table should render.

Obs.: With the type of api-mode equal to true works perfectly, what I need, is that it works with api-mode equal to false.

Vue.use(Vuetable);
new Vue({
  el: '#app',
  data: {
    tableColumns: ['id', 'name'],
    itens: [
        { id: 1, name: "Jogos Vorazes" },
        { id: 2, name: "Todo mundo em Pânico" }
    ],
  }
})
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.3.4/vue.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.16.2/axios.min.js"></script>
<script src="https://unpkg.com/[email protected]"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<div id="app" class="container">

  <h1 class="text-center">Vuejs com VueTable-2</h1>

  <hr>

  <vuetable ref="vuetable"
       :api-mode="false"
       :fields="tableColumns"
       :data="itens">
  </vuetable>
  <pre>{{ itens }}</pre>
</div>


Edited:

The Vuetable-2 project in version 1.6.3 was marked as containing a bug. The opening link in Issue Git. Waiting for correction to close the topic.


Edited (corrected by):

Bug fixed in version v1.6.5.
Note, for those using version 1.6.3 you will be under this bug

  • 1

    It gives me the idea that this project is not working well. I’ve been testing and reading the documentation and nothing to make it work. Your props are according to the documentation. It looks like the same problem as this: https://github.com/ratiw/vuetable-2/issues/176

  • @Sergio, the author of Vuetable tagged as Bug. Now just wait. Thank you.

  • Good! Because it seemed to me too. But there are other Vue-table, on the back you find a more stable project.

1 answer

0

Bug fixed in version v1.6.5.
Note, for those using version 1.6.3 you will be under this bug

Browser other questions tagged

You are not signed in. Login or sign up in order to post.