1.介绍
IBest-UI由 安徽百得思维信息科技有限公司 开源,是一个轻量、简单易用、可定制主题、支持深色模式和浅色模式的鸿蒙开源UI组件库, 包含 Button、Calendar、Form、Field、Picker、Popup、Toast、Dialog、ImageCropper 等50个优质组件,上手简单,使用方便,它类似于前端的element-plus,能为开发者提供高效的开发效率。
目前 ibestservices 官方 提供了 V1 和 V2 版本,当前为状态管理 V1 版本,开发者可根据自己项目使用的状态管理版本选择对应的版本进行开发。
2.下载安装
在终端输入命令 ohpm install @ibestservices/ibest-ui
3.组件介绍
3.1Button 按钮
在页面中引入import { IBestButton } from "@ibestservices/ibest-ui";
效果
Flex({ wrap: FlexWrap.Wrap, space: {main: LengthMetrics.vp(12), cross: LengthMetrics.vp(12)} }) {
IBestButton({
text: '主要按钮',
type: 'primary'
})
IBestButton({
text: '成功按钮',
type: 'success'
})
IBestButton({
text: '默认按钮',
type: 'default'
})
IBestButton({
text: '危险按钮',
type: 'danger'
})
IBestButton({
text: '警告按钮',
type: 'warning'
})
}
代码块