【问题标题】:Vue.js tables: vuetables and vue-tables-2 errorsVue.js 表:vuetables 和 vue-tables-2 错误
【发布时间】:2017-03-29 02:25:45
【问题描述】:

我是 vue.js 的新手,但我需要在表中呈现数据我已经尝试过 vuetables 和 vue-tables-2 但它们都会产生需要我编辑源文件的错误,但我认为不是一个好主意。 我的后端是 Laravel 5.3。 当我使用vuetables 时出现以下错误:

ERROR in ./~/vue-loader/lib/template-compiler.js?id=data-v-369be50a!./~/vue-loader/lib/selector.js?type=template&index=0!./~/vuetable/src/components/VuetablePagination.vue
template syntax error class="{{wrapperClass}}": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div class="{{ val }}">, use <div :class="val">.
 @ ./~/vuetable/src/components/VuetablePagination.vue 8:23-158
 @ ./resources/assets/js/app.js

有了vue-tables-2,我得到了:

    ERROR in ./~/vue-tables-2/lib/template.jsx
Module parse failed: /home/vagrant/Code/project/node_modules/vue-tables-2/lib/template.jsx Unexpected token (15:7)
You may need an appropriate loader to handle this file type.
| var perPage = require('./template/per-page.jsx')(h, this);
| 
| return <div class={"VueTables VueTables--" + this.source}>
|   <div class="row">
|     <div class="col-md-6">
 @ ./~/vue-tables-2/lib/v-client-table.js 1:15-40
 @ ./~/vue-tables-2/index.js
 @ ./resources/assets/js/app.js

有没有办法修复这些错误或我有哪些其他选择?

【问题讨论】:

标签: php laravel-5 vue.js vue-tables-2


【解决方案1】:

vue-tables-2 现在是预编译的,不需要任何转换。

【讨论】:

    【解决方案2】:

    我目前正在使用semantic-ui。我发现它很容易使用,它有很多 UI 组件,包括table。而使用vuetables 和vue-tables-2,您将只能获得表格组件,而对于其他组件,您将不得不使用其他一些库。

    您还可以探索其他 UI 库选项:

    【讨论】:

    • 我正在使用 zurb Foundation,因为它是我们使用的标准 UI 框架,因此我无法切换到语义 UI。不过看起来很酷。我只需要一个专门用于 angular-smart-table 之类的表的包。
    • 如果你愿意,你可以通过只包含来自here 的相关文件来从 sematic-ui 中获取表格组件。
    猜你喜欢
    • 2016-07-23
    • 2019-03-08
    • 1970-01-01
    • 2020-04-21
    • 2018-12-02
    • 2020-07-08
    • 2017-05-27
    • 2018-04-03
    • 2021-01-28
    相关资源
    最近更新 更多