##脱出ゲームの謎解きでよくある、3つの数字を入れると進めるやつ
nazotoki.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="nazotoki.css">
<title>謎解きWEB</title>
</head>
<body>
<div id="app">
<input type="text" v-model="keyWord">
<button v-on:click="onclick">ボタン</button>
{{message}}
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="nazotoki.js"></script>
</body>
</html>
vue.js
new Vue({
el: '#app',
data: {
message: 'hello',
keyWord: ''
},
methods: {
onclick: function(){
if (this.keyWord === '000'){
this.message = 'good';
}else{
this.message = 'bad';
};
}
}
});