世界上所有对自己不利的情况,都是由于当事人能力|

青明尘下

园龄:2年8个月粉丝:1关注:8

微信小程序使用TDesign

TDesign

1.新建一个普通的微信小程序项目

2.在 project.config.json 配置sass插件(非强制,此步可根据自己需要而配置)

image-20230601181159405
"useCompilerPlugins": [
  "sass"
],

3.使用 npm 安装 tdesign,并构建 npm

npm i tdesign-miniprogram -S --production

🎆成功标志

然后,工具 → 构建npm

4.修改 app.json

app.json 中的 "style": "v2" 移除。

5.测试组件

在官网上,随便找一个组件试试

app.json 中引入组件(全局引入)

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

使用组件

wxml

<view class="button-example">
  <t-button theme="primary" ghost size="large">幽灵按钮</t-button>
  <t-button theme="danger" ghost size="large">幽灵按钮</t-button>
  <t-button ghost size="large">幽灵按钮</t-button>
</view>

scss

.button-example {
  display: flex;
  justify-content: space-between;
  background-color: #181818;
  padding: 32rpx;
}

效果图:

image-20230601191550400

本文作者:青明尘下

本文链接:https://www.cnblogs.com/qmcx/p/17449989.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   青明尘下  阅读(2200)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起