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

VUE实例

时间:2018-11-13 13:12:54      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:mes   doctype   alert   nbsp   src   temp   color   style   lang   

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue实例</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="root">
        <div @click="handleClick">
        {{message}}
        </div>
        <item></item>
    </div>
    <script>
        Vue.component(‘item‘,{
           template:‘<div>你好 世界</div>‘
        });


        var vm = new Vue({
          el:‘#root‘,
          data:{
              message:‘hello world‘
          },
            methods:{
              handleClick:function () {
                  alert("hello world")
              }
            }
        })
    </script>
</body>
</html>

 

VUE实例

标签:mes   doctype   alert   nbsp   src   temp   color   style   lang   

原文地址:https://www.cnblogs.com/xuyxbiubiu/p/9951506.html

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