MiniX自绘渲染跨平台框架
  • 框架说明
  • 声明式开发范式
  • 内置Api
指南
接口
  • Minix CLI
示例
  • 类Web框架

    • 框架说明
    • 类Web开发范式
    • 内置Api
  • 指南
  • 组件
  • 接口
  • 示例
  • 规范
  • DophinHybrid

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • DolphinWeex

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • 发布消息
  • 常见问题
  • 更新日志
  • 框架说明
  • 声明式开发范式
  • 内置Api
指南
接口
  • Minix CLI
示例
  • 类Web框架

    • 框架说明
    • 类Web开发范式
    • 内置Api
  • 指南
  • 组件
  • 接口
  • 示例
  • 规范
  • DophinHybrid

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • DolphinWeex

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • 发布消息
  • 常见问题
  • 更新日志
  • 快速上手
  • 基础

    • Grid 布局
    • Icon 图标
      • 代码演示
      • Api
    • Button 按钮
    • Toast 轻提示
    • Cell 列表项
  • 数据录入

    • Checkbox 多选框
    • Radio 单选框
    • Slider 滑杆
    • Switch 滑动开关
    • Picker 滚动选择器
    • Rate 评分
    • SearchBar 搜索栏
  • 数据展示

    • Tag 标记
    • Badge 徽标
    • Blank 缺省页
    • Card 卡片容器
    • Steps 步骤条
    • NoticeBar 提醒栏
    • Swiper 轮播
  • 操作反馈

    • ActionSheet 动作清单
    • Loading 加载
    • Overlay 遮罩层
    • Popup 弹窗
    • PopupImage 图片弹窗
    • PullRefresh 下拉刷新
  • 导航

    • NavBar 导航栏
    • TabBar 标签栏
    • Tab 标签页
  • 媒体

    • Camera 相机
    • Video 视频
  • 美居组件

    • Apng 动态图片
    • Lottie 动画
    • midea-map-view 地图
    • Picker 滚动选择器
    • SeekBar 滑杆
    • ArcSlider 环形控制
    • Progresscycle 环形进度条
    • Gesture Password 手势密码
    • Linechart 折线图
    • Barchart 柱状图
    • Linechart Dragging 可拖拽折线图
    • Pick Pallet 取色器
    • Webview 浏览器视图组件
    • midea-common-weex-view Weex 子窗口
    • midea-common-mx-view Minix 子窗口
    • midea-piechart-view 饼图
    • Video 视频播放器
    • Map 地图
    • Webview 浏览器容器
  • 插件模版

    • Warmer 暖风机

# Icon 图标

请扫码查看示例

# 介绍

用来在主体内容右上角显示徽标数据。

# 引入

通过以下方式来引入组件

  1. 使用包管理器安装mui-minix 组件库。如: npm i mui-minix -S;
  2. 在要使用该组件的页面中使用element标签引入该组件。

# 代码演示

# 基本用法

通过设置 type 属性为图片的链接。

<element name="m-icon" src="@/node_modules/mui-minix/src/icon/index"></element>
<m-icon name="http://dolphin-weex-dev.msmartlife.cn/static/component/card/image/smallcard_ic_015.png"></m-icon>
1
2

# 尺寸大小

通过设置 size 属性,可以改变图标的尺寸。默认为 24。

<element name="m-icon" src="@/node_modules/mui-minix/src/icon/index"></element>
<m-icon name="http://dolphin-weex-dev.msmartlife.cn/static/component/card/image/smallcard_ic_015.png"></m-icon>
<m-icon size="{{32}}" name="http://dolphin-weex-dev.msmartlife.cn/static/component/card/image/smallcard_ic_015.png"></m-icon>
1
2
3

# 显示圆角

通过设置 round 属性,可以让图标显示为圆形。 默认为 false。

<element name="m-icon" src="@/node_modules/mui-minix/src/icon/index"></element>
<m-icon name="http://dolphin-weex-dev.msmartlife.cn/static/component/card/image/smallcard_ic_015.png"></m-icon>
<m-icon round="{{true}}" name="http://dolphin-weex-dev.msmartlife.cn/static/component/card/image/smallcard_ic_015.png"></m-icon>
1
2
3

# 背景颜色

通过 background-color 属性, 可以控制图标的背景颜色。默认为 -。

<element name="m-icon" src="@/node_modules/mui-minix/src/icon/index"></element>
<m-icon background-color="#00cbb8" name="http://dolphin-weex-dev.msmartlife.cn/static/component/card/image/smallcard_ic_015.png"></m-icon>
<m-icon background-color="#ff8225" round="{{true}}" name="http://dolphin-weex-dev.msmartlife.cn/static/component/card/image/smallcard_ic_015.png"></m-icon>
1
2
3

# 右上角圆点

通过设置 dot 属性,可以在图标右上角显示一个实心圆点。默认为 false。

<element name="m-icon" src="@/node_modules/mui-minix/src/icon/index"></element>
<m-icon dot="{{true}}" color="#00cbb8" name="http://dolphin-weex-dev.msmartlife.cn/static/component/card/image/smallcard_ic_015.png"></m-icon>
<m-icon dot="{{true}}" color="#ff8225" round="{{true}}" name="http://dolphin-weex-dev.msmartlife.cn/static/component/card/image/smallcard_ic_015.png"></m-icon>
1
2
3

# 右上角文本

通过设置 badge 属性,可以在图标右上角显示文本。默认为 -。同时设置了 badge 与 dot 属性,badge 优先级更高。

<element name="m-icon" src="@/node_modules/mui-minix/src/icon/index"></element>
<m-icon badge="30" color="#00cbb8" name="http://dolphin-weex-dev.msmartlife.cn/static/component/card/image/smallcard_ic_015.png"></m-icon>
<m-icon badge="100" color="#ff8225" round="{{true}}" name="http://dolphin-weex-dev.msmartlife.cn/static/component/card/image/smallcard_ic_015.png"></m-icon>
<m-icon badge="hot" dot="{{true}}" color="#ff8225" round="{{true}}" name="http://dolphin-weex-dev.msmartlife.cn/static/component/card/image/smallcard_ic_015.png"></m-icon>
1
2
3
4

# 最大值

通过 max 属性, 可以控制图标右上角显示最大数值。默认为 99。

<element name="m-icon" src="@/node_modules/mui-minix/src/icon/index"></element>
<m-icon badge="12" max="{{9}}" name="http://dolphin-weex-dev.msmartlife.cn/static/component/card/image/smallcard_ic_015.png"></m-icon>
1
2

# Api

# Prop

字段 说明 类型 默认值 是否必须
name icon的名称或图片链接 string - 是
round 是否圆角 boolean false 否
size 尺寸 number 24 否
dot 右上角是否显示为圆点 boolean false 否
max 右上角可显示的最大数值 number 99 否
badge 右上角文本内容 string - 否
color 背景颜色 string #ff3b30 否
top 右上角圆点,文本距离包括内容右上角Y轴距离 number 0 否
right 右上角圆点,文本距离包括内容右上角X轴距离 number 0 否

# Events

事件名称 说明 回调参数
m-click 点击时触发,且开关状态不为禁用时触发 -