Vue之属性

Vue中的属性:举例

看一下就明白了

<!DOCTYPE html>  
<html lang="en">  
<head>  
    <meta charset="UTF-8">  
    <title></title>  
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">  
    <meta name="apple-mobile-web-app-capable" content="yes">  
    <meta name="apple-mobile-web-app-status-bar-style" content="black">  
    <style>  
  
    </style>  
    <script src="vue.js"></script>  
    <script>  
        window.onload=function(){  
            new Vue({  
                el:'#box',  
                data:{  
                    url:'https://www.baidu.com/img/bd_logo1.png',  
                    w:'200px',  
                    t:'这是一张美丽的图片'  
                },  
                methods:{  
                }  
            });  
        };  
    </script>  
</head>  
<body>  
    <div id="box">  
        <!--<img src="{{url}}" alt="">-->  
        <img :src="url" alt="" :width="w" :title="t">  
    </div>  
</body>  
</html>  

 

posted @ 2017-10-21 21:31  逗比煎饼侠  阅读(92)  评论(0编辑  收藏  举报