js中一个变量赋值给另一个变量,改变另一个变量,原始变量不变
let a = 0; let b = a; b = 2 console.log("a: "+a);
let obj1 = {value:1}; let obj2 = obj1; obj2.value = 3 console.log(obj1.value);
const a = ref(0); const b = a; b = 2; console.log(a.value);
ref的value本质上是键名
京公网安备 11010502049817号