day 97 VUE第一天

 

 

 day 97 VUE第一天

 

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>111
    </title>
</head>
<body>
    <div id ="app">
        <h2>{{title}}</h2>

    <div class="box">{{content}}</div>

    <!-- v-*:指令系统 -->
    <button v-on:click ="bian">变</button>
</div>

    <script type="text/javascript" src="vue.js"></script>
    <script type="text/javascript">

            //数据驱动视图
            var options ={
                    el: "#app",
                    data:{
                        title :"我是一个h2标题",
                        content:" 嘿嘿嘿"
                    },
                
                methods:{
                    bian:function(){
                        this.title="该了"

                    }
                }
            };
            var app= new Vue(options);
            console.log(app.title)

    </script>

</body>
</html>

 

相关文章:

  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2021-08-09
  • 2021-07-15
  • 2021-12-15
  • 2021-12-20
猜你喜欢
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2021-04-29
  • 2021-12-21
  • 2021-10-16
相关资源
相似解决方案