Skip to content

vue2 main.js 引入后 编译报错  #313

@JCDDYY

Description

@JCDDYY

Bug report

vue2 的项目在引入main.js 运行后报错

出现Bug的组件?

组件配置数据?

控制台错误输出?

Failed to compile with 5 errors 17:25:23

error in ./node_modules/@jiaminghi/data-view/lib/components/conicalColumnChart/src/main.vue

Module parse failed: Unexpected token (163:8)
You may need an appropriate loader to handle this file type.
| const max = data[0] ? data[0].value : 10;
| data = data.map(item => ({
| ...item,
| percent: item.value / max
| }));

@ ./node_modules/@jiaminghi/data-view/lib/components/conicalColumnChart/src/main.vue 4:0-103 5:0-116
@ ./node_modules/@jiaminghi/data-view/lib/components/conicalColumnChart/index.js
@ ./node_modules/@jiaminghi/data-view/lib/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server babel-polyfill ./src/main.js

error in ./node_modules/@jiaminghi/data-view/lib/components/scrollRankingBoard/src/main.vue

Module parse failed: Unexpected token (174:8)
You may need an appropriate loader to handle this file type.
| const total = max + minAbs;
| data = data.map((row, i) => ({
| ...row,
| ranking: i + 1,
| percent: (row.value + minAbs) / total * 100

@ ./node_modules/@jiaminghi/data-view/lib/components/scrollRankingBoard/src/main.vue 4:0-103 5:0-116
@ ./node_modules/@jiaminghi/data-view/lib/components/scrollRankingBoard/index.js
@ ./node_modules/@jiaminghi/data-view/lib/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server babel-polyfill ./src/main.js

error in ./node_modules/@jiaminghi/data-view/lib/components/activeRingChart/src/main.vue

Module parse failed: Unexpected token (222:10)
You may need an appropriate loader to handle this file type.
| series: [{
| type: 'pie',
| ...mergedConfig,
| outsideLabel: {
| show: false

@ ./node_modules/@jiaminghi/data-view/lib/components/activeRingChart/src/main.vue 4:0-103 5:0-116
@ ./node_modules/@jiaminghi/data-view/lib/components/activeRingChart/index.js
@ ./node_modules/@jiaminghi/data-view/lib/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server babel-polyfill ./src/main.js

error in ./node_modules/@jiaminghi/data-view/lib/components/scrollBoard/src/main.vue

Module parse failed: Unexpected token (280:8)
You may need an appropriate loader to handle this file type.
| }
| data = data.map((d, i) => ({
| ...d,
| scroll: i
| }));

@ ./node_modules/@jiaminghi/data-view/lib/components/scrollBoard/src/main.vue 4:0-103 5:0-116
@ ./node_modules/@jiaminghi/data-view/lib/components/scrollBoard/index.js
@ ./node_modules/@jiaminghi/data-view/lib/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server babel-polyfill ./src/main.js

error in ./node_modules/@jiaminghi/data-view/lib/components/flylineChartEnhanced/src/main.vue

Module parse failed: Unexpected token (531:10)
You may need an appropriate loader to handle this file type.
| const time = randomExtend(...duration) / 10;
| return {
| ...item,
| path,
| key,

@ ./node_modules/@jiaminghi/data-view/lib/components/flylineChartEnhanced/src/main.vue 4:0-103 5:0-116
@ ./node_modules/@jiaminghi/data-view/lib/components/flylineChartEnhanced/index.js
@ ./node_modules/@jiaminghi/data-view/lib/index.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server babel-polyfill ./src/main.js

期望情况?

正常运行

实际情况?

报错 五个错误

其他相关信息

  • DataV版本
  • 浏览器版本
  • 其他

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions