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

feat: 减少高亮报错

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