Tag Archives: vue

VUE Run Error: This relative module was not found:

This error is reported when running the vue project.

This relative module was not found:



* ../../assets/img/spot.png in ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/online

Maybe there is a problem with the introduction of spot.png into online.vue, the path is wrong or the file does not exist, and the same is true for similar problems

Build the front-end Vue environment and install the solution of please try running this command again as root / administrator

build the front-end Vue environment, install the solution of please try running this command again as root/administrator for Vue cli build the front-end Vue environment

Reference article:

(1) Build the front-end Vue environment and install the solution of please try running this command again as root/administrator

(2) https://www.cnblogs.com/yajunLi/p/6365758.html

Let’s make a note.

Vue Switch JS ERROR:unexpected lexical declaration in case block

Reason:

“Extensions” in the configuration file:“ eslint:recommended Property enables this rule

This rule prevents lexical declarations (let, const, function, and class) from appearing in case or default clauses. The reason is that the lexical declaration is visible throughout the switch statement block, but it is initialized only when it runs to the case statement it defines

The Usage of v-clock

Summary of v-clock usage

first look at the following code

<ul v-for="item in items">

    <li>{{ item.name }}</li>

</ul>
then, when we use Vue to read data from the background or refresh the page, the response problem may flash{{ item.name }}This one vue.js Template variable, which brings users a bad experience. At this time, v-cloak will come in handy
v-cloak: prevent the variable name of vuejs from appearing during page loading.
method: add v-cloak

to the loading point in HTML

<ul v-cloak v-for="item in items">

     <li>{{ item.name }}</li>

</ul>
and then add

to the CSS

[v-cloak] {

     display: none;

}
explanation: HTML tags containing the v-cloak attribute will be hidden during page initialization.
after vuejs instance ready, the v-cloak attribute will be automatically removed, that is, the corresponding tag will become visible.
then the problem comes again: in actual projects, we usually load the CSS file through @ import
@import "style.css"
the page will not be loaded until the DOM is fully loaded. If we write [v-cloak] in the CSS file loaded by @ import, the page will still flash.
solution: write [v-cloak] in the CSS introduced by link, or write an inline CSS style.

ok!