vue属性绑定和属性简写

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vue属性绑定和属性简写相关的知识,希望对你有一定的参考价值。

<!DOCTYPE html>

<html>

    <head>

        <meta charset="utf-8" />

        <title>属性绑定和属性简写</title>

    </head>

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

    <script>

        window.onload = function(){

            //配置是否允许检查代码,方便调试,生产环境中设置为false

            Vue.config.devtools = true;  //检查代码

            Vue.config.productioinTip = false;  //有强迫症的,可以关掉生产中的提示信息

            let vm = new Vue({

                el: "#div1",

                data:{

                  url: ‘img/super_man.jpg‘,

                    w: ‘100px;‘,

                    h: ‘50px;‘

                }

            });

        }

    </script>

    

    <body>

        <div id="div1">

            <img :src="url" :width="w" :height="h">

        </div>

    </body>

</html>


以上是关于vue属性绑定和属性简写的主要内容,如果未能解决你的问题,请参考以下文章