You've already forked template-MP
Compare commits
2 Commits
22d9602a25
...
7b9ce380b2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b9ce380b2 | ||
|
|
dc272d289f |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
unpackage
|
unpackage
|
||||||
/dist
|
/dist
|
||||||
node_modules
|
node_modules
|
||||||
|
.manifest-updated
|
||||||
12
IFLOW.md
12
IFLOW.md
@@ -196,11 +196,19 @@ npm run upload:weapp
|
|||||||
|
|
||||||
* **资源路径**: 使用全局混入的 `ASSETSURL` 变量
|
* **资源路径**: 使用全局混入的 `ASSETSURL` 变量
|
||||||
* **使用方式**:
|
* **使用方式**:
|
||||||
```javascript
|
```html
|
||||||
// 在template中
|
// 在template中
|
||||||
|
<image src="`${ASSETSURL}image.png`"/>
|
||||||
|
```
|
||||||
|
|
||||||
|
```html
|
||||||
|
// 在CSS中
|
||||||
background-image: url($ASSETSURL + 'image.png')
|
background-image: url($ASSETSURL + 'image.png')
|
||||||
|
```
|
||||||
|
|
||||||
|
```javascript
|
||||||
// 在JavaScript中
|
// 在JavaScript中
|
||||||
|
const ASSETSURL = import.meta.env.VITE_ASSETSURL
|
||||||
const imageUrl = `${ASSETSURL}image.png`
|
const imageUrl = `${ASSETSURL}image.png`
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user