Compare commits

..

2 Commits

2 changed files with 12 additions and 3 deletions

3
.gitignore vendored
View File

@@ -1,3 +1,4 @@
unpackage
/dist
node_modules
node_modules
.manifest-updated

View File

@@ -196,11 +196,19 @@ npm run upload:weapp
* **资源路径**: 使用全局混入的 `ASSETSURL` 变量
* **使用方式**:
```javascript
```html
// 在template中
<image src="`${ASSETSURL}image.png`"/>
```
```html
// 在CSS中
background-image: url($ASSETSURL + 'image.png')
```
```javascript
// 在JavaScript中
const ASSETSURL = import.meta.env.VITE_ASSETSURL
const imageUrl = `${ASSETSURL}image.png`
```