VUE框架v-if
作者:互联网
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="vue3.js"></script>
<style>
.c1{
color: red;
}
.c2{
}
</style>
</head>
<body>
<div id="app">
<h3>展示电影</h3>
<div v-if="age>18">成年电影</div>
<div v-else>青少年电影</div>
<h3>展示成绩</h3>
<div v-if="score>90">优秀</div>
<div v-else-if="score>80">良好</div>
<div v-else-if="score>60">及格</div>
<div v-else>不及格</div>
</div>
<script>
// 数据驱动界面
var vm = Vue.createApp({
data(){
return {
age: 12,
score: 79,
}
},
}).mount("#app")
</script>
</body>
</html>
标签:VUE,框架,Title,color,展示,电影,vm 来源: https://www.cnblogs.com/A121/p/16364667.html