1

I apply markdown in nuxt vue this way.

<template>
  <div class="doc-container">
    <div v-html="doc"/>
  </div>
</template>

<script>
import doc from './doc.md'
export default {
  name: 'doc',
  data() {
    return {
      doc:doc
    }
  },
}
</script>

in doc.md file, I need add a image, but how can I resolve the image path? http://localhost:3000/guide/~@/assets/images/create.jpg 404 (Not Found)

![image](~@/assets/images/create.jpg)

now the problem is

kissu
  • 40,416
  • 14
  • 65
  • 133
Jack.Z
  • 21
  • 5

1 Answers1

1

You can drop your images in the /static folder. e.g. a file placed here /static/images/create.jpg would be mapped to the root like this:

![image](/images/create.jpg)
Mulhoon
  • 1,852
  • 21
  • 26