Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用微信原生组件json文件配置了不生效,编译后微信小程序的json就变成{"component":true,"usingComponents":{}} #17005

Open
wuqi-y opened this issue Dec 11, 2024 · 1 comment

Comments

@wuqi-y
Copy link

wuqi-y commented Dec 11, 2024

相关平台

微信小程序

小程序基础库: 3.4.7
使用框架: React

复现步骤

在commponts新建一个 studentAuth原生组件

studentAuth.json的内容如下

{
  "component": true,
  "usingComponents": {
    "studentVerify": "plugin://studentVerify/verify"
  }
}

studentAuth.wxml内容如下

<!--pages/studentAuth.wxml-->
<studentVerify
  bind:auth="onStudentVerifyAuth"
  bind:reject="onStudentVerifyReject"
  bind:close="onStudentVerifyClose"
  show="{{ true }}"
></studentVerify>

手动在小程序里加上这个导入就可以正常调用 但是实际被覆盖
编译后变成{"component":true,"usingComponents":{}} 手动改后每次也是被覆盖 希望给个解决方案

期望结果

希望在taro原生组件页面改json后,小程序也生效

实际结果

改完被覆盖没有生效

环境信息

👽 Taro v3.6.27


  Taro CLI 3.6.27 environment info:
    System:
      OS: Windows 10 10.0.16299
    Binaries:
      Node: 18.18.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD
      npm: 9.8.1 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 3.6.27 => 3.6.27
      @tarojs/components: 3.6.27 => 3.6.27
      @tarojs/helper: 3.6.27 => 3.6.27
      @tarojs/plugin-framework-react: 3.6.27 => 3.6.27
      @tarojs/plugin-mini-ci: ^3.6.31 => 3.6.31
      @tarojs/plugin-platform-alipay: 3.6.27 => 3.6.27
      @tarojs/plugin-platform-h5: 3.6.27 => 3.6.27
      @tarojs/plugin-platform-jd: 3.6.27 => 3.6.27
      @tarojs/plugin-platform-qq: 3.6.27 => 3.6.27
      @tarojs/plugin-platform-swan: 3.6.27 => 3.6.27
      @tarojs/plugin-platform-tt: 3.6.27 => 3.6.27
      @tarojs/plugin-platform-weapp: 3.6.27 => 3.6.27
      @tarojs/react: 3.6.27 => 3.6.27
      @tarojs/runtime: 3.6.27 => 3.6.27
      @tarojs/shared: 3.6.27 => 3.6.27
      @tarojs/taro: 3.6.27 => 3.6.27
      @tarojs/taro-loader: 3.6.27 => 3.6.27
      @tarojs/webpack5-runner: 3.6.27 => 3.6.27
      babel-preset-taro: 3.6.27 => 3.6.27
      eslint-config-taro: 3.6.27 => 3.6.27
      react: ^18.0.0 => 18.3.1
      taro-ui: ^3.3.0 => 3.3.0
@wuqi-y
Copy link
Author

wuqi-y commented Dec 11, 2024

已经找到解决方案 在app.config添加配置即可

  "usingComponents": {
    "studentVerify": "plugin://studentVerify/verify"
  }

This was referenced Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant