Get the App
SLTechnology News&Howtos  ›  Development  › 

How vue sets file reference path aliases

Shulou Source: shulou.com Published: 2022-06-01 04:18:14 09月22日 Update

This article mainly shows you the "vue how to set file reference path aliases", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "vue how to set file reference path aliases" this article.

Set file reference path alias

Sometimes there are too many project files, and references like ".. / static/data/xx.json" may often appear, which are troublesome to write and easy to make mistakes (of course, it doesn't matter if the code compiler can prompt). To simplify the path, we can configure aliases in build/webpack.base.conf.js.

This is to simplify the path by calling the resolve method. For example, you can directly use @ to replace src, or you can directly write "api/xx.js" instead of finding it layer by layer.

The above is all the contents of the article "how to set file reference path aliases in vue". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Path alias file content article study help it doesn't matter no code method easy to understand more sometimes organization purpose knowledge editing compiler industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi OPPO Reno Docker MySQL MariaDB