не могу запустить Vue.js на JSFiddle с библиотекой Vue - PullRequest
0 голосов
/ 09 ноября 2018

Я использую библиотеку Vue.js vue-good-table , но я не могу запустить ее должным образом на JSFiddle здесь . Я включил файлы библиотеки JS и CSS и сам Vue.js. Я что-то не так делаю?

Ошибка:

Uncaught ReferenceError: VueGoodTablePlugin is not defined

Мой код:

HTML:

<div id="app">
<div>
  <vue-good-table
  :columns="columns"
  :rows="rows"/>
</div>
</div>

JS:

Vue.use(VueGoodTablePlugin);

1 Ответ

0 голосов
/ 09 ноября 2018

удалить Vue.use (VueGoodTablePlugin);

example:
new Vue({
  el: "#app",
  data: {
    columns: [
        {
          label: 'Name',
          field: 'name',
        },
        {
          label: 'Age',
          field: 'age',
          type: 'number',
        },
        {
          label: 'Created On',
          field: 'createdAt',
          type: 'date',
          dateInputFormat: 'YYYY-MM-DD',
          dateOutputFormat: 'MMM Do YY',
        },
        {
          label: 'Percent',
          field: 'score',
          type: 'percentage',
        },
      ],
      rows: [
        { id:1, name:"John", age: 20, createdAt: '201-10-31:9: 35 am',score: 0.03343 },
        { id:2, name:"Jane", age: 24, createdAt: '2011-10-31', score: 0.03343 },
        { id:3, name:"Susan", age: 16, createdAt: '2011-10-30', score: 0.03343 },
        { id:4, name:"Chris", age: 55, createdAt: '2011-10-11', score: 0.03343 },
        { id:5, name:"Dan", age: 40, createdAt: '2011-10-21', score: 0.03343 },
        { id:6, name:"John", age: 20, createdAt: '2011-10-31', score: 0.03343 },
      ]
  },
  methods: {
    toggle: function(todo){
        todo.done = !todo.done
    }
  }
})

https://jsfiddle.net/hamiltongabriel/x21b9Lmy/4/

...