Skip to content

Commit

Permalink
fix: lazy load extension icons
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-psi committed Jan 22, 2024
1 parent c02505e commit 7d7652f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"element-plus": "^2.5.2",
"lodash.groupby": "^4.6.0",
"markdown-it-shortcode-tag": "^1.1.0",
"unplugin-element-plus": "^0.8.0"
"unplugin-element-plus": "^0.8.0",
"v-lazy-image": "^2.1.1"
},
"devDependencies": {
"@mdit/plugin-attrs": "^0.8.0",
Expand Down
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, toRefs } from 'vue'
import VLazyImage from 'v-lazy-image';
import { GITHUB_EXTENSION_BASE } from '../../../config/constants';
import type { Extension } from '../../queries/useExtensionsRepositoryQuery'
import type { Extension } from '../../queries/useExtensionsRepositoryQuery';
const props = defineProps<{ item: Extension }>()
Expand All @@ -14,7 +14,7 @@ const apkUrl = `${GITHUB_EXTENSION_BASE}/apk/${props.item.apk}`;
<template>
<div :id="pkgId" class="extension" tabindex="-1">
<a :href="`#${pkgId}`" class="anchor" aria-hidden="true" @click.stop>#</a>
<img class="extension-icon" :src="iconUrl" loading="lazy" width="42" height="42">
<v-lazy-image class="extension-icon" width="42" height="42" :src="iconUrl" />
<div class="extension-text">
<div class="upper">
{{ pkgName }}
Expand Down

0 comments on commit 7d7652f

Please sign in to comment.