yinLiangDream / mp-colorui

MP-COLORUI 是基于 Taro框架的组件库,由于作者平时工作较忙,有时回复不及时,有事可以加QQ群 1145534886 咨询,文档请看这里→
https://yinliangdream.github.io/mp-colorui-doc/
MIT License
365 stars 41 forks source link

taro Vue引入包就报错. #97

Closed smarttang closed 3 years ago

smarttang commented 4 years ago

为了更好的定位以及解决问题,在提交 ISSUE 时,我希望你

  1. 标明 mp-colorui 的版本号 最新的版本,0.6.19
  2. 标明 Taro 的版本号 v3.0.11
  3. 贴出关于这次问题的相关代码或截图 vue的代码:
    
    <!--
    * @Description: 
    * @Autor: Smarttang
    * @Date: 2020-09-21 00:16:39
    * @LastEditTime: 2020-09-21 23:21:12
    -->
    <template>
    <view class="index">
    <AtGrid
      :data="
    [
    {
      image: 'https://img12.360buyimg.com/jdphoto/s72x72_jfs/t6160/14/2008729947/2754/7d512a86/595c3aeeNa89ddf71.png',
      value: '领取中心'
    },
    {
      image: 'https://img20.360buyimg.com/jdphoto/s72x72_jfs/t15151/308/1012305375/2300/536ee6ef/5a411466N040a074b.png',
      value: '找折扣'
    },
    {
      image: 'https://img10.360buyimg.com/jdphoto/s72x72_jfs/t5872/209/5240187906/2872/8fa98cd/595c3b2aN4155b931.png',
      value: '领会员'
    },
    {
      image: 'https://img12.360buyimg.com/jdphoto/s72x72_jfs/t10660/330/203667368/1672/801735d7/59c85643N31e68303.png',
      value: '新品首发'
    },
    {
      image: 'https://img14.360buyimg.com/jdphoto/s72x72_jfs/t17251/336/1311038817/3177/72595a07/5ac44618Na1db7b09.png',
      value: '领京豆'
    },
    {
      image: 'https://img30.360buyimg.com/jdphoto/s72x72_jfs/t5770/97/5184449507/2423/294d5f95/595c3b4dNbc6bc95d.png',
      value: '手机馆'
    }
    ]"
      :onClick="handleClick.bind(this, '')"
    />
    </view>
    </template>
    <script>
    import Taro from "@tarojs/taro";
    import { ClIcon } from "mp-colorui";

export default { name: "Index", methods: { handleClick(item, index) { this.$taro.navigateTo({ url: /pages/view/test/index?id=${index}, }); }, }, };

只要引入组件,就会报错。

➜ taro git:(master) ✗ npm run dev:h5

myapp@1.0.0 dev:h5 /Users/smarttang/Desktop/taro npm run build:h5 -- --watch

myapp@1.0.0 build:h5 /Users/smarttang/Desktop/taro taro build --type h5 "--watch"

👽 Taro v3.0.11

⠋ Compiling...ℹ 「wds」: Project is running at http://192.168.0.106:10086/ ℹ 「wds」: webpack output is served from / ℹ 「wds」: Content not from webpack is served from /Users/smarttang/Desktop/taro/dist ℹ 「wds」: 404s will fallback to /index.html http://192.168.0.106:10086/

ℹ️ Listening at http://0.0.0.0:10086/

监听文件修改中...

🙅 Failed to compile.

./node_modules/mp-colorui/dist/h5/components/accordion/index.js Module build failed (from ./node_modules/@tarojs/webpack-runner/node_modules/babel-loader/lib/index.js): SyntaxError: /Users/smarttang/Desktop/taro/node_modules/mp-colorui/dist/h5/components/accordion/index.js: Support for the experimental syntax 'jsx' isn't currently enabled (27:12):

25 | } 26 | }, [show]);

27 | return <View className={classNames("cu-list menu", { | ^ 28 | "card-menu": card 29 | }, props.className)} style={Object.assign({ 30 | overflow: "hidden",

Add @babel/plugin-transform-react-jsx (https://git.io/vb4yd) to the 'plugins' section of your Babel config to enable transformation.

✅ Compiled successfully!

✅ Compiled successfully!

🙅 Failed to compile.

./node_modules/mp-colorui/dist/h5/components/accordion/index.js Module build failed (from ./node_modules/@tarojs/webpack-runner/node_modules/babel-loader/lib/index.js): SyntaxError: /Users/smarttang/Desktop/taro/node_modules/mp-colorui/dist/h5/components/accordion/index.js: Support for the experimental syntax 'jsx' isn't currently enabled (27:12):

25 | } 26 | }, [show]);

27 | return <View className={classNames("cu-list menu", { | ^ 28 | "card-menu": card 29 | }, props.className)} style={Object.assign({ 30 | overflow: "hidden",

Add @babel/plugin-transform-react-jsx (https://git.io/vb4yd) to the 'plugins' section of your Babel config to enable transformation.

🙅 Failed to compile.

./node_modules/mp-colorui/dist/h5/components/accordion/index.js Module build failed (from ./node_modules/@tarojs/webpack-runner/node_modules/babel-loader/lib/index.js): SyntaxError: /Users/smarttang/Desktop/taro/node_modules/mp-colorui/dist/h5/components/accordion/index.js: Support for the experimental syntax 'jsx' isn't currently enabled (27:12):

25 | } 26 | }, [show]);

27 | return <View className={classNames("cu-list menu", { | ^ 28 | "card-menu": card 29 | }, props.className)} style={Object.assign({ 30 | overflow: "hidden",

Add @babel/plugin-transform-react-jsx (https://git.io/vb4yd) to the 'plugins' section of your Babel config to enable transformation.

yinLiangDream commented 3 years ago

不支持VUE噢