AnimatedIcon-DEMO
vue
<fv-AnimatedIcon fontSize="36">
</fv-AnimatedIcon>1
2
2
Present Animation
- Scale Down
vue
<fv-AnimatedIcon fontSize="20">
</fv-AnimatedIcon>1
2
2
- Scale X Down
vue
<fv-AnimatedIcon modelValue="scaleXDown" fontSize="20" icon="GlobalNavButton">
</fv-AnimatedIcon>1
2
2
- Scale Y Down
vue
<fv-AnimatedIcon modelValue="scaleYDown" fontSize="20" icon="Pause">
</fv-AnimatedIcon>1
2
2
- Back Scale
vue
<fv-AnimatedIcon modelValue="backScale" fontSize="20" icon="Back">
</fv-AnimatedIcon>1
2
2
- Bounce Rotate
vue
<fv-AnimatedIcon modelValue="bounceRotate" fontSize="20" icon="Settings">
</fv-AnimatedIcon>1
2
2
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>1
2
3
4
5
2
3
4
5
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>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Event types include
enter,move,down,up,leaveand corresponding to theMouseEventandTouchEventautomatically.Each event can be declared as an
objectcontain styles or anarraycontain multiple styles object. The transitions of anarraywill execute in order.
AnimatedIcon-Customize Background
vue
<fv-AnimatedIcon modelValue="scaleYDown" fontSize="20" icon="Pause" background="whitesmoke">
</fv-AnimatedIcon>1
2
2
AnimatedIcon-Dark Theme
vue
<fv-AnimatedIcon theme="dark" fontSize="20">
</fv-AnimatedIcon>1
2
2
属性
| 属性 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| modelValue | string | 否 | 'scaleDown' | 动画预设名称。 |
| icon | string | 否 | 'Search' | Icon with Fabric-Icon |
| customizeAnimation | boolean | 否 | false | 自定义动画。 |
| background | string | 否 | '' | 背景色。 |
| fontSize | number | 否 | 16 | AnimatedIcon 字体大小。 |
| hideContent | boolean | 否 | false | 隐藏文本内容。 |
| theme | string | 否 | 'global' | 主题样式。支持 global、light、dark、system 和 custom。 |
| disabled | boolean | 否 | false | 参见组件的 disabled 选项。 |
| lang | string | 否 | "global" | 参见组件的 lang 选项。 |
事件
| 事件名 | 参数 | 说明 |
|---|---|---|
| click | event | AnimatedIcon onclick |
插槽
- Default
默认模板是图标自定义模板
javascript
<fv-animated-icon>
<div></div>
</fv-animated-icon>1
2
3
2
3
- Content
客制化修改文字内容
javascript
<fv-animated-icon>
<template v-slot:content>
<div>Content</div>
</template>
</fv-animated-icon>1
2
3
4
5
2
3
4
5