提交 ee984f47 编写于 作者: 辛宝Otto's avatar 辛宝Otto 🥊

feat: 减少高亮报错

上级 4be12db1
......@@ -58,7 +58,7 @@ background-image: url(../../static/logo.png);
例:有如下目录结构 ,在static 和页面文件夹下分别有静态资源
```base
```text
├── pages
│ └── index
......@@ -73,13 +73,13 @@ background-image: url(../../static/logo.png);
``` html
<!-- /pages/index/index.vue -->
<template>
<template>
<view class="content">
<image src="../../static/logo.png" />
<image src="../../static/logo.png" />
<image src="/static/logo.png" />
<image src="@static/logo.png" />
</view>
</template>
</view>
</template>
```
......@@ -87,23 +87,23 @@ background-image: url(../../static/logo.png);
``` html
<!-- /pages/index/index.vue -->
<template>
<view class="content">
<template>
<view class="content">
<image :src="src" />
</view>
</template>
</view>
</template>
<script>
// 使用 import 引入静态资源,并在 data 中赋值引用
import icon_src from './icon.png'
export default {
data() {
import icon_src from './icon.png'
export default {
data() {
return {
src: icon_src
}
},
}
</script>
}
},
}
</script>
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册