docs_vue2/one/docs/demo/icon/default.vue

71 lines
1.1 KiB
Vue
Raw Normal View History

2020-08-13 11:47:56 +08:00
<template>
<article>
<div
v-for="name in names"
:key="name"
class="item"
>
<div class="icon">
<veui-icon :name="name"/>
</div>
<div class="name">
{{ name }}
</div>
</div>
</article>
</template>
<script>
import { Icon } from 'veui'
import 'veui-theme-dls-icons'
export default {
components: {
'veui-icon': Icon
},
data () {
return {
2021-09-15 20:23:08 +08:00
names: Object.keys(Icon.icons)
.filter(name => !name.startsWith('one-demo-') && Icon.icons[name])
.sort()
2020-08-13 11:47:56 +08:00
}
}
}
</script>
2021-09-15 20:03:51 +08:00
<style lang="less" scoped>
2020-08-13 11:47:56 +08:00
article {
overflow: hidden;
}
.item {
2021-09-15 20:03:51 +08:00
@grid-size: 120px;
2020-08-13 11:47:56 +08:00
float: left;
width: @grid-size;
height: calc(@grid-size + 3em);
text-align: center;
margin: 1em 2em;
.icon {
width: @grid-size;
height: @grid-size;
border: 1px solid transparent;
font-size: 1.5em;
line-height: @grid-size;
border-radius: 4px;
2021-09-15 20:03:51 +08:00
transition: border-color 0.2s;
2020-08-13 11:47:56 +08:00
&:hover {
border-color: #ccc;
}
}
.name {
margin-top: 0.6em;
color: #333;
font-size: 0.8em;
white-space: nowrap;
}
}
</style>