1.使用微信小程序的Terminal執(zhí)行:
npm i tdesign-miniprogram -S --production
2.修改project.config.json
"packNpmManually": true,
"packNpmRelationList": [
{
"packageJsonPath": "./package.json",
"miniprogramNpmDistDir": "./miniprogram/"
}
]
?3.修改app.json,移除"style":?"v2"
4.編譯npm:微信開發(fā)者工具的Tools->構建npm文章來源:http://www.zghlxwxcb.cn/news/detail-505222.html
5.在頁面下的頁面json中導入要使用的組件,在wxml中使用文章來源地址http://www.zghlxwxcb.cn/news/detail-505222.html
{
"usingComponents": {
"t-button": "tdesign-miniprogram/button/button"
}
}
<t-button>按鈕</t-button>
到了這里,關于微信小程序使用TDesign(TS版本)的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!