vue基礎-常用屬性及其實現的功能
阿新 • • 發佈:2018-06-09
idt json char v-model del AC charset put bmi
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Vue js</title> </head> <body>v-model:使內容與data中的內容一致 v-show:可根據條件進行顯示 v-if:與v-show類似 el:‘#app‘ //綁定id為app的div區域<div id="app"> <h1>{{message}}</h1> <input type="text" v-model="message"> <pre> {{$data | json}} </pre> <form action=""> <div class="errror" v-if="!message">You must enter a message to submit</div> <textarea name="" id="" cols="30" rows="10" v-model=‘message‘></textarea> <button v-show="message">Send message</button> </form> </div> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script> <script> new Vue({ el:‘#app‘, data:{ message:"Hello World!" } }) </script> </body> </html>
vue基礎-常用屬性及其實現的功能