principle, realize
principle, realize
principle, realize
principle, realize
as shown in the following figure, first make a judgment that target is not data of type undefined, null, string, number, symbol, and boolean.
1. If target is an array, change the length of the array according to the key value and the length of the array (take the larger one), and then directly use the splice function to modify the array. Although vue does not listen for array changes, it listens for the push,pop,shift,unshift,splice,sort,reverse
function of the array, so you can also use splice to update dom
2. If target is an object and key is an existing private property of the object, then you can assign the value directly, because the key must be a monitored
.3. If the key does not currently exist in the object, it will be assigned and listened. The judgment of ob is omitted here, so what is ob? the data initialized in vue (such as the data in data) will be monitored during page initialization, and the listening attributes will be bound to the _ _ ob__ attribute. Here is to determine whether the data has been monitored. If the data is not monitored, then by default you do not want to listen to the data, so assign the value directly and return
finally, $set is set
Vue.prototype.$set = set;
there is a benchmarks directory in some open source projects, such as vue , which is very popular now. The literal translation of benchmark means benchmark test. It seems that some functional performance tests can be done. given that there is a test di...
how to introduce and use font-awesome in vue projects? If index.html introduces the style file directly, it will report an error. ...
text suddenly becomes larger when there is too much content. normal effect: : : style: <style lang= scss module> .about_con { padding: 0 20px; .content { margin-bottom:20px; p { font-size: 30px; } .title{ f...
1. Develop a full-screen scrolling project in vue and use the fullpage plug-in. When you add a second screen, the error code is as follows. 2. checked that the error was missing the root element, but there was no missing root element after careful...
problem description my project has the following warning on, run dev after upgrading a ui component library: There are multiple modules with names that only differ in casing. This can lead to unexpected behavior when compiling on a filesystem with ot...
data has watchform this.form.cat_id=1_7eb3340579783ab51bf7e110f7a4f397this.formwatch this.$set(this.form, cat_id , 1_7eb3340579783ab51bf7e110f7a4f397 ),this.formwatch what I don t understand even more is to use this.form.xx=yy to modif...
I have done a mobile function to simulate scrolling. The scrolling container contains pictures arranged vertically. At the beginning, I wrote the width and height of the pictures in css. Because the simulated scrolling needs to obtain the height of the c...
does Mini Program have such a mechanism, or is it written incorrectly? This kind of application scenario is quite common, isn t it? ...
I know that merge strategies can be used when components are reused. In general, for what purpose, you need to customize the policy. There is no specific actual demo. ...
error occurs when page refresh is introduced, and the whole project cannot be refreshed if introduced globally solution ...
key ...
here s the thing. Vue.js has a project to set a lot of default values. There are about 20 or 30 default values. put in data is too long, the subject is just a piece of cake, want to ask if there is a better solution, do not have to put so many, too u...
above picture, the picture can say clearly green is click to enter, yellow is the return of Wechat in the upper left corner when I enter the list page from A.html, click to enter the editing information, go to the success page, click back to jump to t...
current projects use vue, and native websocket. After logging in to the business, I use a unified js file as the entry for processing websocket, including websocket creation, connection, and message processing. I thought the message I was dealing with wa...
use this edit box, < div contenteditable= "true " > when I edit a line wrap, it automatically adds a p tag, but I pass the data to the service and refresh the data obtained from the page to be displayed on the page, right? this tag is also displayed. ...
for example, the user logs in and gets the user data after the login is successful. What if there are multiple JS files that need user data? ...
recently, I was working on a project with vue+elementUI. When I was doing a shopping cart, I was thinking about how it was sent to the backend when the number in the shopping cart changed. If I changed it once, it would definitely be bad. Then I went to ...
shortly after I entered VUE, I encountered a download demand and put it directly on the a tag. As a result, I couldn t find the address, but the page img could display it, and the picture could be downloaded under the static file. I don t know why. I a...
there is no effect after clicking, and the console does not respond Code section: change(item) { console.log(item); } ...
Why better-scroll can t scroll with the mouse, it can only be dragged. Awkward. I don t know 50 meters ...