Skip to content

AnimatedIcon-DEMO


vue
<fv-AnimatedIcon fontSize="36">
</fv-AnimatedIcon>

Present Animation


  1. Scale Down
vue
<fv-AnimatedIcon fontSize="20">
</fv-AnimatedIcon>
  1. Scale X Down
vue
<fv-AnimatedIcon modelValue="scaleXDown" fontSize="20" icon="GlobalNavButton">
</fv-AnimatedIcon>
  1. Scale Y Down
vue
<fv-AnimatedIcon modelValue="scaleYDown" fontSize="20" icon="Pause">
</fv-AnimatedIcon>
  1. Back Scale
vue
<fv-AnimatedIcon modelValue="backScale" fontSize="20" icon="Back">
</fv-AnimatedIcon>
  1. Bounce Rotate
vue
<fv-AnimatedIcon modelValue="bounceRotate" fontSize="20" icon="Settings">
</fv-AnimatedIcon>

AnimatedIcon-With Content


vue
<fv-AnimatedIcon modelValue="bounceRotate" fontSize="20" icon="Settings">
    <template v-slot:content>
        <div style="margin-left: 5px;">Settings</div>
    </template>
</fv-AnimatedIcon>

AnimatedIcon-Customize Animation


vue
<fv-AnimatedIcon :customizeAnimation="animation" fontSize="20" icon="Settings">
</fv-AnimatedIcon>

<script>
data () {
    return {
        animation: {
            enter: {
                transform: 'rotate(-180deg)',
                transition: `transform 0.1s`
            },
            leave: [
                {
                    transform: 'rotate(365deg)',
                    transition: `transform 0.3s`
                },
                {
                    transform: 'rotate(360deg)',
                    transition: `transform 0.1s`
                },
                {
                    transform: 'rotate(0deg)'
                }
            ]
        }
    }
}
</script>
  • Event types include enter, move, down, up, leave and corresponding to the MouseEvent and TouchEvent automatically.

  • Each event can be declared as an object contain styles or an array contain multiple styles object. The transitions of an array will execute in order.

AnimatedIcon-Customize Background


vue
<fv-AnimatedIcon modelValue="scaleYDown" fontSize="20" icon="Pause" background="whitesmoke">
</fv-AnimatedIcon>

AnimatedIcon-Dark Theme


vue
<fv-AnimatedIcon theme="dark" fontSize="20">
</fv-AnimatedIcon>

Propoties


属性(attr)类型(type)必填(required)默认值(default)说明(statement)
valueStringNoscaleDown动画预设名称
iconStringNoN/AIcon with Fabric-Icon
customizeAnimationObjectNoN/A自定义动画
background[string(color)]NoN/A背景色
fontSizeNumberNo16AnimatedIcon 字体大小
hideContent[bool]Nofalse隐藏文本内容
themeStringNosystem主题样式, 包含light, dark, system, custom几种样式

Events


事件名(Name)参数类型(args)说明(statement)
clickeventAnimatedIcon onclick

Slot


  1. Default

默认模板是图标自定义模板

javascript
<fv-animated-icon>
    <div></div>
</fv-animated-icon>
  1. Content

客制化修改文字内容

javascript
<fv-animated-icon>
    <template v-slot:content>
        <div>Content</div>
    </template>
</fv-animated-icon>

MIT Licensed