图标 Icon

基本

  1. <div class="grid">
  2. <div v-for="(i, index) in ICONS" class="grid-column" style="width: 33.33%;display: inline-block;padding: 15px;text-align: center;" :key="index">
  3. <za-icon theme="primary" :type="i" class="icon"></za-icon>
  4. <span class="icon-name"></span>
  5. </div>
  6. </div>

Iconfont Symbol自定义图标

  1. <div class="grid">
  2. <div class="grid-column" style="width: 33.33%;display: inline-block;padding: 15px;text-align: center;">
  3. <za-icon tag="symbol" theme="primary" type="home" class="icon"></za-icon>
  4. <span class="icon-name">home</span>
  5. </div>
  6. <div class="grid-column" style="width: 33.33%;display: inline-block;padding: 15px;text-align: center;">
  7. <za-icon tag="symbol" theme="primary" type="insurance" class="icon"></za-icon>
  8. <span class="icon-name">insurance</span>
  9. </div>
  10. <div class="grid-column" style="width: 33.33%;display: inline-block;padding: 15px;text-align: center;">
  11. <za-icon tag="symbol" theme="primary" type="user" class="icon"></za-icon>
  12. <span class="icon-name">user</span>
  13. </div>
  14. </div>

Iconfont Symbol使用说明

  1. import { Icon } from 'zarm-vue';
  2. Icon.createSymbolIconfont('//at.alicdn.com/t/font_1340918_4p9b5skcr79.js');

Vue Script

  1. <script name="vue">
  2. const ICONS = [
  3. 'right', 'right-round', 'right-round-fill',
  4. 'wrong', 'wrong-round', 'wrong-round-fill',
  5. 'info-round', 'info-round-fill',
  6. 'question-round', 'question-round-fill',
  7. 'warning-round', 'warning-round-fill',
  8. 'arrow-left', 'arrow-right', 'arrow-top', 'arrow-bottom',
  9. 'add', 'add-round', 'add-round-fill',
  10. 'minus', 'minus-round', 'minus-round-fill',
  11. 'broadcast', 'search',
  12. ].sort();
  13. export default {
  14. data() {
  15. return {
  16. ICONS,
  17. i: null
  18. }
  19. }
  20. };
  21. </script>

API

Icon Attributes

属性类型默认值可选值/参数说明
themestring'default''default', 'primary', 'info', 'success', 'warning', 'error'主题
typestring'right', 'right-round', 'right-round-fill','wrong', 'wrong-round', 'wrong-round-fill', 'info-round', 'info-round-fill', 'question-round', 'question-round-fill', 'warning-round', 'warning-round-fill', 'arrow-left', 'arrow-right', 'arrow-top', 'arrow-bottom', 'add', 'add-round', 'add-round-fill', 'minus', 'minus-round', 'minus-round-fill', 'broadcast', 'search'图标类型
tagstring'symbol'iconfont symbol类型图标

Icon 图标 - 图1