当前位置:网站首页>About stepping on the pit diary and the association of knowledge points

About stepping on the pit diary and the association of knowledge points

2022-06-11 02:18:00 Little mushroom lady in brick moving world

// notes : The grammar of this article vue
1、vue in

:src=" Ternary judgment condition  ? ****( Picture path ) : ****( Picture path )"
 Put the picture path into data in , Such as   Variable name : require("../../ Related path ")   notes require To add ,web End displayable , however h5 Some mobile phones do not display 

2、

let select = {
     id: 123, name: 'ab' };
let old = {
     id: 123, name: '123' };
// When select The value of is assigned to old When 
this.old = {
     ...this.select }  // Construction assignment : Do not use this method , If select Every time it changes ,old The values in the will change accordingly 

// And so on   If it's an array 
let select = [{
    },{
    },{
    }];
let old = [];
this.old = [ ...this.select ];


// Object construction 
// Example :
function getData() {
    
	return {
     a: 42, b: 'foo' }
}
let {
     a,b } = this.getData();
console.log(a,b);    //42,'foo'
	// amount to 
	let res = getData();
	let a = res.a;
	let b = res.b;
// Use scenarios : Interface 
const {
     data } =  api. The interface name ();
//{data} When applied data,  Interface returns data  { data: {}, result: {}, code: 200}
原网站

版权声明
本文为[Little mushroom lady in brick moving world]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203020614381266.html