v-bind
<태그 v-bind:id="데이터"></태그><태그 :id="데이터"></태그>사용 예제 - 비밀번호 힌트
<!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>Welcome to Vue JS 3</title>
</head>
<body>
<div id="app">
<h1>비밀번호 입력</h1>
<input v-bind:type="type" v-model="password">
<input type="checkbox" v-model="visible"> 비밀번호 표시
</div>
<script src="https://unpkg.com/vue@next"></script>
<script>
const app = Vue.createApp({
data(){
return {
password:"",
visible:false,
};
},
computed:{
type(){
return this.visible ? "text" : "password";
},
}
});
app.mount("#app");
</script>
</body>
</html>사용 예제 - 다음 단계 버튼 활성화
Last updated