Configure icon types (Material Design vs iconfont)
masterThe component supports two icon systems. You must ensure the corresponding CSS is loaded in your project.
Material Design Icons
- Include the Material Icons stylesheet in your
index.html:<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> - Set
iconType: 'MaterialDesign'in theVue.use()configuration. - Pass icon names (e.g.,
icon="add") to the components.
Alibaba Iconfont
- Include your iconfont CSS as per Alibaba's instructions.
- Set
iconType: 'iconfont'in theVue.use()configuration. - Pass icon class names (e.g.,
icon="icon-jia") to the components.
<!-- Material Design Example -->
<vue-fab mainBtnColor="#3599DB">
<fab-item @clickItem="clickItem" :idx="0" title="add" icon="add" />
</vue-fab>
<!-- Iconfont Example -->
<vue-fab icon="icon-jia" fabItemAnimate="default" mainBtnColor="#16C2C2">
<fab-item @clickItem="clickBABA" icon="icon-Rxing" :idx="0" title="iconfont.cn" />
</vue-fab>