我是靠谱客的博主 俊秀水杯,这篇文章主要介绍vue的基础,现在分享给大家,希望可以做个参考。

vue   是一套构建用户界面的渐进式框架

页面闪烁  v-cloak

属性绑定 v-bind  事件绑定 v-on

冒泡事件 从里到外  捕获事件 capture  一次once self自身 

也可以有多个修饰符       prevent阻止   

双向绑定 适合input    原理 通过改变视图层的数据来改变大小 

循环   数组    

<li v-for="(item,index) in couseList">

                {{index}} --{{item.titile}}

            </li>

对象

 <div v-for="(value,key,index) in person">

            {{value}}--{{key}}---{{index}}

        </div>

数字

 <li v-for="(item,index) in 9">

            {{item}}--{{index}}

        </li>

双for循环

 <div class="father" v-for="item in courseSectoin">  

            {{item.father}}

            <div class="son" v-for="(item2,index) in item.section">

                {{item2.son}}

            </div>

        </div>

v-if和v-show的区别

 v-if删除dom元素

        v-show设置display:none

key的作用

 提高重排效率  要求是字符串或者数字  唯一

最后

以上就是俊秀水杯最近收集整理的关于vue的基础的全部内容,更多相关vue内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(59)

评论列表共有 0 条评论

立即
投稿
返回
顶部