前端
This commit is contained in:
28
frontend/app/web-gold/src/components/icons/Icon.vue
Normal file
28
frontend/app/web-gold/src/components/icons/Icon.vue
Normal file
@@ -0,0 +1,28 @@
|
||||
<template>
|
||||
<svg :class="['gm-icon', cls]" :width="size" :height="size" aria-hidden="true">
|
||||
<use :href="`#${name}`" />
|
||||
</svg>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
name: { type: String, required: true },
|
||||
size: { type: [Number, String], default: 16 },
|
||||
class: { type: String, default: '' },
|
||||
})
|
||||
|
||||
const cls = computed(() => props.class)
|
||||
defineOptions({ name: 'GmIcon' })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.gm-icon {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
color: currentColor;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
67
frontend/app/web-gold/src/components/icons/SvgSprite.vue
Normal file
67
frontend/app/web-gold/src/components/icons/SvgSprite.vue
Normal file
@@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" style="position:absolute;width:0;height:0;overflow:hidden" aria-hidden="true" focusable="false">
|
||||
<symbol id="icon-topic" viewBox="0 0 24 24">
|
||||
<path d="M5 12a7 7 0 1 1 6.8 7.0l-3.3 2.0.8-3.2A6.9 6.9 0 0 1 5 12Z" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<circle cx="8" cy="18" r="1" fill="currentColor"/>
|
||||
<circle cx="6" cy="16" r="1" fill="currentColor"/>
|
||||
</symbol>
|
||||
|
||||
<symbol id="icon-paragraph" viewBox="0 0 24 24">
|
||||
<path d="M4 5.5A2.5 2.5 0 0 1 6.5 3H20v16.5H7a3 3 0 0 0-3 3V5.5Z" fill="none" stroke="currentColor" stroke-width="1.6"/>
|
||||
<path d="M7 3v16.5" fill="none" stroke="currentColor" stroke-width="1.6"/>
|
||||
</symbol>
|
||||
|
||||
<symbol id="icon-video" viewBox="0 0 24 24">
|
||||
<rect x="3" y="5" width="14" height="14" rx="2" fill="none" stroke="currentColor" stroke-width="1.6"/>
|
||||
<path d="M17 9l4-2v10l-4-2v-6Z" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/>
|
||||
<path d="M3 9h14" fill="none" stroke="currentColor" stroke-width="1.2" stroke-dasharray="2 2"/>
|
||||
</symbol>
|
||||
|
||||
<symbol id="icon-sparkle" viewBox="0 0 24 24">
|
||||
<path d="M12 3l1.2 3.5L17 8l-3.8 1.2L12 13l-1.2-3.8L7 8l3.8-1.5L12 3Z" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/>
|
||||
</symbol>
|
||||
|
||||
<symbol id="icon-spinner" viewBox="0 0 24 24">
|
||||
<circle cx="12" cy="12" r="9" fill="none" stroke="currentColor" stroke-width="2" opacity="0.2"/>
|
||||
<path d="M21 12a9 9 0 0 0-9-9" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
||||
</symbol>
|
||||
|
||||
<symbol id="icon-eye" viewBox="0 0 24 24">
|
||||
<path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z" fill="none" stroke="currentColor" stroke-width="1.6"/>
|
||||
<circle cx="12" cy="12" r="3" fill="none" stroke="currentColor" stroke-width="1.6"/>
|
||||
</symbol>
|
||||
|
||||
<symbol id="icon-edit" viewBox="0 0 24 24">
|
||||
<path d="M4 20l4.5-1 10-10a1.5 1.5 0 0 0-2.1-2.1L6.5 16.9 5 21 4 20Z" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/>
|
||||
</symbol>
|
||||
|
||||
<symbol id="icon-copy" viewBox="0 0 24 24">
|
||||
<rect x="9" y="7" width="11" height="13" rx="2" fill="none" stroke="currentColor" stroke-width="1.6"/>
|
||||
<rect x="4" y="4" width="11" height="13" rx="2" fill="none" stroke="currentColor" stroke-width="1.6"/>
|
||||
</symbol>
|
||||
|
||||
<symbol id="icon-save" viewBox="0 0 24 24">
|
||||
<path d="M4 4h12l4 4v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Z" fill="none" stroke="currentColor" stroke-width="1.6"/>
|
||||
<path d="M7 4v6h10V6l-2-2H7Z" fill="none" stroke="currentColor" stroke-width="1.6"/>
|
||||
</symbol>
|
||||
|
||||
<symbol id="icon-cancel" viewBox="0 0 24 24">
|
||||
<path d="M6 6l12 12M18 6L6 18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
|
||||
</symbol>
|
||||
|
||||
<symbol id="icon-empty-doc" viewBox="0 0 24 24">
|
||||
<rect x="4" y="3" width="16" height="18" rx="2" fill="none" stroke="currentColor" stroke-width="1.6"/>
|
||||
<path d="M8 8h8M8 12h8M8 16h5" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
|
||||
</symbol>
|
||||
</svg>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
// 无逻辑,仅提供一次性注入的 symbol sprite
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 隐藏容器但保留 DOM */
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user