<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="js/vue.js"></script>
</head>
<body>
<div id="app">
<!--判断正确就会展示对应的提示-->
<input type="text" v-model="status" class="id">
<div v-if="status==1">启用</div>
<div v-else>禁用</div>
</div>
<script>
new Vue({
el: "#app",
data: {
status: ""
}
})
</script>
</body>
</html>
【Vue】条件渲染
最新推荐文章于 2024-11-04 23:47:32 发布