Vue-tables-2: options is not defined error

Created on 11 Apr 2018  路  1Comment  路  Source: matfish2/vue-tables-2

  • Vue.js version: 2.5.16
  • consumed using: webpack
  • FULL error message (including stack trace):
Uncaught ReferenceError: options is not defined
    at Object.render (app.js:53864)
    at __webpack_require__ (app.js:20)
    at Object.<anonymous> (app.js:53762)
    at __webpack_require__ (app.js:20)
    at Object.<anonymous> (app.js:16082)
    at __webpack_require__ (app.js:20)
    at Object.<anonymous> (app.js:16055)
    at __webpack_require__ (app.js:20)
    at app.js:63
    at app.js:66
  • relevant code:
<template>
    <div>
        <v-server-table url="/api/test" :columns="columns" :options="options"></v-server-table>
    </div>
</template>

<script>
    import {ServerTable, ClientTable, Event} from 'vue-tables-2';

    Vue.use(ServerTable, [options = {}], [useVuex = false], [theme = 'bootstrap4'], [template = 'default']);

    export default {
        name: "TestTableComponent",
        data() {
            return {
                columns: ['id', 'name'],
                options: {
                    perPage: 10
                }
            }
        }
</script>

I can't understand why error occured. I've defined options inside data() and in documentation is was said "You can also nest it within other components" that I did. Or I have to create a new Vue component with el: "#DIV_ID" anyway?

Most helpful comment

Vue.use(ServerTable, [options = {}], [useVuex = false], [theme = 'bootstrap4'], [template = 'default']);

The above code is only for the purpose of documentation. You should use:

Vue.use(ServerTable, {}, false, 'bootstrap4');

>All comments

Vue.use(ServerTable, [options = {}], [useVuex = false], [theme = 'bootstrap4'], [template = 'default']);

The above code is only for the purpose of documentation. You should use:

Vue.use(ServerTable, {}, false, 'bootstrap4');
Was this page helpful?
0 / 5 - 0 ratings

Related issues

deryckoe picture deryckoe  路  3Comments

VladZen picture VladZen  路  4Comments

djokoabdullah picture djokoabdullah  路  3Comments

JKHeadley picture JKHeadley  路  4Comments

bb78657 picture bb78657  路  6Comments