Skip to content

功能集成

集成 Vant Weapp

  1. 安装 Vant Weapp 依赖

    bash
    npm i @vant/weapp -S --production
  2. 打开微信开发者工具,点击 工具 -> 构建 npm,并勾选 使用 npm 模块 选项,构建完成后,即可引入组件。

  3. 修改 app.json

    json
    {
      "style": "v2" // 删除这个配置
    }
  4. 引入组件(以 Button 为例)

    app.jsonindex.json 中配置 Button 对应的路径

    json
    "usingComponents": {
      "van-button": "@vant/weapp/button/index"
    }

集成 Ant Design Mini

Ant Design Mini

  1. 安装依赖

    bash
    npm i antd-mini --save
  2. 工具 -> 构建 npm

  3. 在页面配置的 usingComponents 字段中引入 antd-mini 组件

    json
    {
      "usingComponents": {
        "ant-button": "antd-mini/Button/index"
      }
    }
  4. 在页面中使用 antd-mini 组件

    xml
    <ant-button type="primary" bindtap="handleTap">主要按钮</ant-button>

集成 TDesign

TDesign

基于 MIT 许可发布