【问题标题】:Bootstrap-table data-show-column in react反应中的引导表数据显示列
【发布时间】:2017-01-09 20:45:44
【问题描述】:

我希望能够通过下拉菜单进行选择,哪些列显示在我的 React 表格​​中。

类似于此示例中的内容:http://issues.wenzhixin.net.cn/bootstrap-table/

我想使用工具栏中的“列”下拉按钮。但我不能在 React 中使用它..

我试图做这样的事情:https://fiddle.jshell.net/wenyi/uzgkzjcp/7/light/

但我收到此错误消息:

./~/bootstrap-table/package.json 中的错误 模块解析失败:..\node_modules\bootstrap-table\package.json 意外令牌 (2:9) 您可能需要适当的加载程序来处理此文件类型。 SyntaxError:意外的令牌 (2:9) 在 Parser.pp$4.raise (....\node_modules\acorn\dist\acorn.js:2221:15) 在 Parser.pp.unexpected (....\node_modules\acorn\dist\acorn.js:603:10) 在 Parser.pp.semicolon (....\node_modules\acorn\dist\acorn.js:581:61) 在 Parser.pp$1.parseExpressionStatement (....\node_modules\acorn\dist\acorn.js:966:10) 在 Parser.pp$1.parseStatement (....\node_modules\acorn\dist\acorn.js:730:24) 在 Parser.pp$1.parseBlock (....\node_modules\acorn\dist\acorn.js:981:25) 在 Parser.pp$1.parseStatement (....\node_modules\acorn\dist\acorn.js:709:33) 在 Parser.pp$1.parseTopLevel (....\node_modules\acorn\dist\acorn.js:638:25) 在 Parser.parse (....\node_modules\acorn\dist\acorn.js:516:17) 在 Object.parse (....\node_modules\acorn\dist\acorn.js:3098:39) @ ./~/bootstrap-table/Gruntfile.js 104:22-47

有人有想法吗? 谢谢!

【问题讨论】:

  • 显示你做了什么。

标签: reactjs bootstrap-table


【解决方案1】:

我对 bootstrap-table 也有同样的错误。为了解决这个问题,我不得不编辑 ~/bootstrap-table/package.json。

有一条线

"main":"Gruntfile.js",

我把它改成了

"main": "./dist/bootstrap-table.js",

我不完全理解,但我怀疑 Gruntfile.js 设计为在服务器端运行,而我们在客户端运行它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-01-24
    • 1970-01-01
    • 2014-09-30
    • 2020-11-14
    • 2021-06-20
    • 1970-01-01
    • 2017-02-07
    • 2022-04-14
    相关资源
    最近更新 更多