当前位置:网站首页>What did I read in order to understand the to do list

What did I read in order to understand the to do list

2022-07-03 10:13:00 DadongDer

Tip 1
v-text and v-html:v-html You can remove the label from the variable , and v-text You can't , It shows a string
Test data  Insert picture description here
Execution effect  Insert picture description here

Tip 2
stay input In the input box, we can use v-model Instruction to implement bidirectional data binding

Tip 3
Website to explain :https://cn.vuejs.org/v2/guide/list.html# use -v-for- An array is mapped to a set of elements
 Insert picture description here
 Insert picture description here
Tip 4 export And export default
1、export And export default Can be used to export constants 、 function 、 file 、 Module etc.
2、 You can use... In other files or modules import+( Constant | function | file | modular ) How to name , Import it into , So that it can be used
3、 In a file or module ,export、import There can be multiple ,export default There is only one
4、 adopt export How to export , Add... When importing { },export default You don't need to

In fact, many times export And export default Can achieve the same purpose , But there are some differences in usage . Pay attention to Article 4 , adopt export How to export , Add... When importing { },export default You don't need to . Use export default command , Specify the default output for the module , This way, you don't need to know the variable name of the module to be loaded .
Boss information :https://www.cnblogs.com/xiaotanke/p/7448383.html

Tip 5 data Use return The parcel
The simple example seen in the rookie tutorial is like this
 Insert picture description here
Try to understand others
This is something new … Insert picture description here
In the original project using componentization, it will be written like this … Netizens said not to use return The package data will be visible throughout the project , Can cause variable pollution ; Use return Variables in post package data only take effect in the current component , No impact on other components .

Tip 6 Connect V-for Use a Dongdong
From the official website of conscience
 Insert picture description here
push() Add an element to the last side of the array , Successfully returned the length of the current array
pop() Delete the last element of the array , Successfully returned the value of the deleted element
shift() Deletes the first element of the array , Successfully returned the value of the deleted element
unshift() Add an element to the front of the array , Successfully returned the length of the current array
splice() There are three parameters , The first is the subscript of the element you want to delete ( Mandatory ), The second is the number you want to delete ( Mandatory ), The third is to delete
The value you want to replace in the original position ( Optional )
sort() The array is sorted from small to large by default according to the character encoding , The sorted array is returned successfully
reverse() Reverse array , Successfully returned array after reverse order

I can read most of what netizens wrote to do list This is the simplest one I found on the Internet , Completely Xiaobai, I began to find out what I thought I might understand . Here is a record of my enlightenment reading …https://blog.csdn.net/yang_da_da/article/details/79550685
Now I'm going to try my own adaptation …

原网站

版权声明
本文为[DadongDer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202150538403168.html