NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.68k stars 4.79k forks source link

vant-weapp组件引入报错 #12580

Open Pentium286 opened 2 years ago

Pentium286 commented 2 years ago

相关平台

微信小程序

小程序基础库: 2.26.1 使用框架: Vue 2

复现步骤

把vant-weapp的dist放到components文件夹下

app.config.js

引入 usingComponents: { 'van-button': './components/vant-weapp/button/index', "van-icon": './components/vant-weapp/icon/index', },

期望结果

不报错

实际结果

image 报错了

环境信息

 Taro v3.5.6

  Taro CLI 3.5.6 environment info:
    System:
      OS: macOS 12.6
      Shell: 5.8.1 - /bin/zsh
    Binaries:
      Node: 16.17.0 - /usr/local/bin/node
      npm: 8.15.0 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 3.5.6 => 3.5.6
      @tarojs/components: 3.5.6 => 3.5.6
      @tarojs/helper: 3.5.6 => 3.5.6
      @tarojs/plugin-framework-vue2: 3.5.6 => 3.5.6
      @tarojs/plugin-html: ^3.5.6 => 3.5.6
      @tarojs/plugin-platform-alipay: 3.5.6 => 3.5.6
      @tarojs/plugin-platform-jd: 3.5.6 => 3.5.6
      @tarojs/plugin-platform-qq: 3.5.6 => 3.5.6
      @tarojs/plugin-platform-swan: 3.5.6 => 3.5.6
      @tarojs/plugin-platform-tt: 3.5.6 => 3.5.6
      @tarojs/plugin-platform-weapp: 3.5.6 => 3.5.6
      @tarojs/router: 3.5.6 => 3.5.6
      @tarojs/runtime: 3.5.6 => 3.5.6
      @tarojs/shared: 3.5.6 => 3.5.6
      @tarojs/taro: 3.5.6 => 3.5.6
      @tarojs/taro-h5: 3.5.6 => 3.5.6
      @tarojs/webpack5-runner: 3.5.6 => 3.5.6
      babel-preset-taro: 3.5.6 => 3.5.6
      eslint-config-taro: 3.5.6 => 3.5.6
Chen-jj commented 2 years ago

@mac-boss 麻烦提供一下完整 demo

nico-summer commented 2 years ago

@mac-boss 麻烦提供一下完整 demo

vue版的taro根据文档来引入必报这个错的。。。