search

Home  >  Q&A  >  body text

javascript - vue file download problem

As the title says, I placed a .docx document file in the src/assets directory

I want to implement the click-to-download function, but it seems that it doesn’t work in vue, and the resources cannot be referenced. How can I achieve this?

过去多啦不再A梦过去多啦不再A梦2805 days ago749

reply all(1)I'll reply

  • 为情所困

    为情所困2017-05-18 10:54:39

    :href="require('src')"
    If you don’t do this, you need to manually move the file to the build.
    If you require it, the corresponding loader of webpack will process and package it into the build,
    So you still have to Requires configurations such as file-loader;

    reply
    0
  • Cancelreply