码迷,mamicode.com
首页 > 其他好文 > 详细

vue基础-常用属性及其实现的功能

时间:2018-06-09 17:10:06      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:功能   text   rip   ack   color   根据   htm   submit   vue.js   

<!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>
    <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/vue@2.5.16/dist/vue.js"></script>
    <script>
      new Vue({
         el:#app,
         data:{
            message:"Hello World!"
         }    
      })
    </script>
</body>
</html>
v-model:使内容与data中的内容一致
v-show:可根据条件进行显示
v-if:与v-show类似
el:#app‘  //绑定id为app的div区域

vue基础-常用属性及其实现的功能

标签:功能   text   rip   ack   color   根据   htm   submit   vue.js   

原文地址:https://www.cnblogs.com/qianjin1/p/9160171.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!