mirror of https://github.com/YunYouJun/valaxy
docs: add how to use relative assets
This commit is contained in:
parent
16b27811d4
commit
02d40f342b
|
@ -284,6 +284,30 @@ const { headers, handleClick } = useOutline()
|
|||
|
||||
> 更多可参见 [PressOutline | valaxy-theme-press](https://github.com/YunYouJun/valaxy/blob/main/packages/valaxy-theme-press/components/PressOutline.vue)。
|
||||
|
||||
## 引用静态资源
|
||||
|
||||
当主题需要内置一些静态资源(如:图片等),你可以通过相对引用的方式实现。(这在 `scss` 样式文件中也适用)
|
||||
|
||||
譬如 `assets` 与 `components` 处于同一目录下时:
|
||||
|
||||
```vue
|
||||
<!-- assets/images/valaxy-logo.png -->
|
||||
<!-- components/ValaxyLogo.vue -->
|
||||
<script lang="ts" setup>
|
||||
import valaxyLogoPng from '../assets/images/valaxy-logo.png'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<img max-w="50" m="auto" :src="valaxyLogoPng" alt="Valaxy Logo" z="1">
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.test-image {
|
||||
background-image: url('../assets/images/valaxy-logo.png');
|
||||
}
|
||||
</style>
|
||||
```
|
||||
|
||||
## Third Plugin
|
||||
|
||||
### 实现评论
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
"@antfu/utils": "^0.7.2",
|
||||
"@ctrl/tinycolor": "^3.6.0",
|
||||
"@iconify-json/carbon": "^1.1.16",
|
||||
"@iconify-json/ri": "^1.1.7",
|
||||
"@iconify-json/ri": "^1.1.8",
|
||||
"@intlify/unplugin-vue-i18n": "^0.10.0",
|
||||
"@types/body-scroll-lock": "^3.1.0",
|
||||
"@vitejs/plugin-vue": "^4.1.0",
|
||||
|
|
|
@ -168,8 +168,8 @@ importers:
|
|||
specifier: ^1.1.16
|
||||
version: 1.1.16
|
||||
'@iconify-json/ri':
|
||||
specifier: ^1.1.7
|
||||
version: 1.1.7
|
||||
specifier: ^1.1.8
|
||||
version: 1.1.8
|
||||
'@intlify/unplugin-vue-i18n':
|
||||
specifier: ^0.10.0
|
||||
version: 0.10.0(vue-i18n@9.2.2)
|
||||
|
@ -1070,8 +1070,8 @@ packages:
|
|||
'@iconify/types': 2.0.0
|
||||
dev: false
|
||||
|
||||
/@iconify-json/ri@1.1.7:
|
||||
resolution: {integrity: sha512-ra80AV2Q0wFuzT3YB48DKy0q3IWmmIh2ZbDnMGNX2Wz1lOx9PHgcewVvThk8OaUJOeGkneTMAzKQ64MRrOXEpg==}
|
||||
/@iconify-json/ri@1.1.8:
|
||||
resolution: {integrity: sha512-yykDISjVwFxvuQ/XJhko8gf848DTUlxa/Sa71iVJ5xWgMzCN7gC5cAKs17RNUufZadAiiauK2odX5hlUkR3CNQ==}
|
||||
dependencies:
|
||||
'@iconify/types': 2.0.0
|
||||
dev: false
|
||||
|
|
Loading…
Reference in New Issue