WeChat Mini Program Demo

repository·master·Indexed 27 days ago

https://github.com/wechat-miniprogram/miniprogram-demo

Source code examples for WeChat Mini Programs demonstrating various features and API usages. Includes implementation guides for ARModel cloud functions and a comprehensive set of TDesign components such as t-cell, t-row, t-col, t-collapse, t-count-down, t-icon, and t-image.

Tokens
86K
Snippets
93
Records
557
Agent score
92%

What's inside miniprogram-demo

  1. Install the TDesign Image component

    master

    You can introduce the t-image component either globally or locally in your WeChat Mini Program.

    Global introduction: Add the component to the usingComponents field in your app.json file.

    Local introduction: Add the component to the usingComponents field in the index.json file of the specific page or component where it is needed.

    "usingComponents": {
        "t-image": "tdesign-miniprogram/image/image"
    }
  2. Install and import the Tag component

    master

    You can import the t-tag and t-check-tag components either globally or locally in your WeChat Mini Program.

    Global Import: Configure app.json in the miniprogram root directory. Local Import: Configure the index.json of the specific page or component where you need them.

    "usingComponents": {
      "t-tag": "tdesign-miniprogram/tag/tag",
      "t-check-tag": "tdesign-miniprogram/check-tag/check-tag"
    }
  3. Import the Divider component

    master

    You can import the t-divider component either globally or locally:

    • Global Import: Add the component to the usingComponents field in your app.json file.
    • Local Import: Add the component to the usingComponents field in the index.json file of the specific page or component where it is needed.
    "usingComponents": {
      "t-divider": "tdesign-miniprogram/divider/divider"
    }
  4. Import TDesign Layout components

    master

    You can import the Layout components (t-row and t-col) either globally or locally:

    Global Import: Add the components to the usingComponents field in your app.json file.

    Local Import: Add the components to the usingComponents field in the index.json file of the specific page or component where they are needed.

    "usingComponents": {
      "t-row": "tdesign-miniprogram/row/row",
      "t-col": "tdesign-miniprogram/col/col"
    }
  5. Setup and run the WeChat Mini Program demo

    master

    To run this demo, follow these steps:

    1. Initialize the project by running npm run init in the root directory.
    2. Open the project using WeChat DevTools.
    3. In WeChat DevTools, navigate to Tools (工具) and select Build npm (构建npm).

    Requirements:

    npm run init
  6. Import the Loading component

    master

    You can import the t-loading component either globally or locally.

    Global Import: Add the component to the usingComponents field in your app.json file.

    Local Import: Add the component to the usingComponents field in the index.json file of the specific page or component where it is needed.

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