Skip to content

Latest commit

 

History

History
94 lines (63 loc) · 3.38 KB

File metadata and controls

94 lines (63 loc) · 3.38 KB
title description spline
Uni App Chat
TDesign UniApp Chat is a UI component library for Uni App.
explain

Preview

Please use WeChat to scan the QR code to preview the TDesign UniApp example. ↓

Before use

Before using it, please make sure you have studied WeChat’s official Simple Tutorial on Mini Programs and Introduction to Custom Components.

Installation

npm

TDesign MiniProgram already supports using NPM to install third-party packages. For details, see NPM Support

npm i tdesign-miniprogram -S --production

After installation, npm needs to be built in WeChat developer tools: tool - build npm.(If NPM packages not found appears during the build, please go to the project.config.json file to add the packNpmManually and packNpmRelationList configuration items. For details, see NPM Support)

After the build is successful, check the box Compile JS to ES5

Modify app.json

Remove "style": "v2" in app.json.

Because v2 configuration means enabling a new version of component styles, it will cause TDesign component styles to be disordered.

Modify tsconfig.json

If you use typescript to develop, you need to modify tsconfig.json to specify paths

{
  "paths": {
      "tdesign-miniprogram/*":["./miniprogram/miniprogram_npm/tdesign-miniprogram/*"]
    }
}

Use components

Taking the button component as an example, you only need to introduce the custom component corresponding to the button in the JSON file.

{
  "usingComponents": {
    "t-button": "tdesign-miniprogram/button/button"
  }
}

Then you can use the component directly in wxml.

<t-button theme="primary">按钮</t-button>

Preview in developer tools

# Install project dependencies
npm install

# compile
npm run dev

Open WeChat Developer Tools and add the _example directory to preview the example.

Base library version

Minimum base library version ^2.12.0

Correspondence between component and basic library versions

组件 API 最低基础库 描述
Upload wx.previewMedia 2.12.0 -
Upload wx.chooseMedia 2.10.0 -
Upload wx.chooseMessageFile 2.5.0 -
Navbar wx.getMenuButtonBoundingClientRect 2.1.0 -