Files
airz-uniapp/components/AppIcon.uvue
T
hujun 60b58442ce chore: add ide configs, new svg icon and optimize header & icon component
1. 新增.idea系列IDE配置文件
2. 添加圆形箭头svg图标
3. 优化AppHeader返回图标尺寸和位置
4. 重构AppIcon支持svg矢量图标
2026-09-11 18:06:08 +08:00

15 lines
908 B
Plaintext

<template>
<image class="app-icon" :class="(muted ? 'muted-icon ' : '') + (isVector ? 'vector-icon' : '')" :style="iconStyle" :src="iconSrc" mode="aspectFit"></image>
</template>
<script setup lang="uts">
const props = defineProps({ name: { type: String, default: 'sparkles' }, size: { type: Number, default: 42 }, muted: { type: Boolean, default: false } })
const isVector = computed(() => props.name == 'chevron-right' || props.name == 'arrow-right')
const iconSrc = computed(() => isVector.value ? '/static/icons/' + (props.name == 'chevron-right' ? 'chevron-circle' : 'arrow-right') + '.svg' : '/static/icons-generated/' + props.name + '.png')
const iconStyle = computed(() => 'width:' + props.size + 'rpx;height:' + props.size + 'rpx;')
</script>
<style>
.app-icon { display: block; flex-shrink: 0; transform: scale(1.2); }.vector-icon { transform: none; }.muted-icon { opacity: .48; }
</style>