84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
This is the situation of the console in the imported js
This is the case in elements
nav has not changed either.How is this going?
I don’t see where the problem is. When asking questions, first clarify your thoughts and expose the problem points.
Answer questions
Can’t js be introduced into the vue project to control the class of elements?
It is possible to introduce tools such as jQuery to operate the dom
In fact, it is very convenient to deal with such problems in VueJS, here is an example.
View online https://jsfiddle.net/wqbtt12c/
The specific code is as follows:
点我
const classPool = ['red', 'blue', 'yellow']; new Vue({ el: '#app', data() { return { classStr: 'red' } }, methods: { changeClass() { this.classStr = classPool[Math.ceil(Math.random()*3.0) - 1]; } } });
#app > p { width: 100px; height: 100px; line-height: 100px; text-align: center; } .red { background: red; } .blue { background: blue; } .yellow { background: yellow; }
In the vue project, the operation must be mounted after the element to be operated is mounted. I fainted.
I don’t see where the problem is. When asking questions, first clarify your thoughts and expose the problem points.
Answer questions
It is possible to introduce tools such as jQuery to operate the dom
In fact, it is very convenient to deal with such problems in VueJS, here is an example.
View online https://jsfiddle.net/wqbtt12c/
The specific code is as follows:
In the vue project, the operation must be mounted after the element to be operated is mounted. I fainted.