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

自定义元指令-素指令

时间:2017-08-24 01:09:34      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:max   charset   pre   scale   rip   device   cap   splay   oct   

<!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>
        zns-red{
            width:100px;
            background: gray;
            height:100px;
            display: block;
        }
    </style>
    <script src="vue.js"></script>
    <script>
        Vue.elementDirective(zns-red,{
            bind:function(){
                this.el.style.background=red;
            }
        });

        window.onload=function(){
            var vm=new Vue({
                el:#box,
                data:{
                    a:blue
                }
            });
        };

    </script>
</head>
<body>
    <div id="box">
        <zns-red></zns-red>
    </div>

</body>
</html>

 

自定义元指令-素指令

标签:max   charset   pre   scale   rip   device   cap   splay   oct   

原文地址:http://www.cnblogs.com/lanlanJser/p/7420910.html

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