14. Resource path configuration in Vuepress2.x non-root directory

Option One

Recommendation : VuePress provides a built-in helper $withBase(which is injected into the Vue prototype) that can help you generate the correct path.

<!-- 图片在 public/images/ 下 -->
<img :src="$withBase('/images/structure.png')" style="width:100%;height:100%;">

Option II

Not recommended : onlythe file README.MD (docs\README.md) in the root directory without /

<!-- 图片在 public/images/ 下 -->
<img src="images/structure.png" style="width:100%;height:100%;">

Guess you like

Origin blog.csdn.net/sinat_31213021/article/details/132364324