1.圖標類型
<uni-icon>組件中,type可以用來指定圖標的不同樣式。
<uni-icons type="circle" size="30" color="#007aff"></uni-icons> //表示圓形
<uni-icons type="square" size="30" color="#007aff"></uni-icons> //表示方形
<uni-icons type="triangle" size="30" color="#007aff"></uni-icons> //表示三角形
<uni-icons class="input-uni-icon" type="search" size="1" color="#999" /> //表示搜索圖形
2.表單控件類型
在表單元素中,type屬性用于指定輸入控件的類型。
<input type="text" placeholder="文本輸入框">
<input type="password" placeholder="密碼輸入框">
<input type="checkbox"> 復選框
<input type="radio"> 單選框
<input type="file"> 文件選擇
3.數據可視化圖標類型
在數據可視化庫中,type屬性用于指定圖表的類型
// 使用 Plotly 創建柱狀圖
Plotly.newPlot('myDiv', [{x: [1, 2, 3, 4],y: [10, 15, 13, 17],type: 'bar' // 柱狀圖
}]);// 使用 Plotly 創建餅圖
Plotly.newPlot('myDiv', [{labels: ['A', 'B', 'C'],values: [10, 20, 30],type: 'pie' // 餅圖
}]);
4.自定義組件中的類型
<my-component type="primary">主要按鈕</my-component>
<my-component type="secondary">次要按鈕</my-component>
<my-component type="danger">危險按鈕</my-component>