小编Sud*_*jee的帖子

在实现 vue 表时获取错误“在编译模板时发出的值而不是错误实例”

我正在尝试使用节点模块在我的应用程序中使用 Vue 表插件来实现 Vue 表。在这里,我在使用所有 Vue 表组件时遇到错误。在这里,我使用 npm 安装了所有 Vue 表插件并将它们导入到我的自定义组件中。

我的代码片段附在这里。

import Vuetable from 'vuetable/src/components/Vuetable.vue';
import VuetablePagination from 'vuetable/src/components/VuetablePagination.vue';
import VuetablePaginationDropdown  from 'vuetable/src/components/VuetablePaginationDropdown.vue';
Run Code Online (Sandbox Code Playgroud)

这里首先我将 vue table 插件导入到我的组件中。然后将此类组件注册到我的自定义组件中到 vue 实例中。

 data () { 
   return{
     columns: [
          'name',
          'nickname',
          'email',
          'birthdate',
          'gender',
          '__actions'
        ]
      }
    },
    components : {
        Vuetable,
        VuetablePagination,
        VuetablePaginationDropdown
    }
Run Code Online (Sandbox Code Playgroud)

在模板部分,我编写了这段代码。

<vuetable
     api-url="http://vuetable.ratiw.net/api/users"
     table-wrapper="#content"
     pagination-component="vuetable-pagination"
     :fields="columns">
</vuetable>
Run Code Online (Sandbox Code Playgroud)

javascript vue.js vuejs2

5
推荐指数
1
解决办法
1268
查看次数

标签 统计

javascript ×1

vue.js ×1

vuejs2 ×1