vue233/04-computed属性的使用/对象增强写法.html

44 lines
795 B
HTML
Raw Permalink Normal View History

2022-10-15 10:05:34 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
<script>
//ES5对象赋值时的写法
// let name="张一凡";
// let age=23;
// let address="翻斗花园";
// const app={
// name:name,
// age:age,
// address:address,
// }
//<--这是ES6对象增强写法-->
let name="张一凡";
let age=23;
let address="翻斗花园";
const app={
name,
age,
address,
}
//这是ES5函数的写法
const fun={
//这是ES5函数的写法
look:function(){
},
//这是ES6函数的写法
run(){
}
}
console.log(app);
</script>
</html>