perf(theme): improve prepare icons data

This commit is contained in:
pengzhanbo 2024-07-26 16:50:00 +08:00
parent 4c44462e61
commit 46b382e0b3
2 changed files with 3 additions and 3 deletions

View File

@ -61,7 +61,7 @@ const bind = computed<any>(() => ({
<span v-if="!loaded" class="vp-icon" :style="{ color, width: size, height: size }" />
<OfflineIcon
v-else-if="icon"
class="vp-iconify"
class="vp-icon"
v-bind="bind"
/>
</ClientOnly>

View File

@ -16,8 +16,8 @@ interface IconData {
type CollectMap = Record<string, string[]>
type IconDataMap = Record<string, IconData>
const ICON_REGEXP = /<(?:VP)?Icon(?:ify)?([^>]*)>/g
const ICON_NAME_REGEXP = /name="([^"]+)"/
const ICON_REGEXP = /<(?:VP)?(Icon|Card|LinkCard)([^>]*)>/g
const ICON_NAME_REGEXP = /(?:name|icon)="([^"]+)"/
const URL_CONTENT_REGEXP = /(url\([\s\S]+\))/
const JS_FILENAME = 'internal/iconify.js'
const CSS_FILENAME = 'internal/iconify.css'