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

vue 2.0版本----》常用代码说明

时间:2017-01-06 13:58:40      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:display   cache   渲染   att   路径   img   one   play   method   

------------------------------------------代码不显示--------------------------------------------

[v-cloak] {
  display: none;
}

<li v-for="(list, index) in info.Product_List.data" v-cloak>

-----------------------------------------vue2.0 $set变更--------------------------------------------

var list = new Vue({
  el:"#list2",
  data:{
    info:""
  },
  methods:{
  ajax_data:function(cache){
    var _self=this;
    ajax_ing =$.ajax({
      url:"url",
      type:"get",
      data:{},
      dataType:"json",
      success:function(data){

        Vue.set(list ,"info",data.info);
        list.$nextTick(function () {

        })
      }
    })
   }
  }
})

-----------------------------------------vue2.0 src or url渲染时加路径--------------------------------------------

v-bind:src="‘../pc/images/‘+list.gameImg"

-----------------------------------------vue2.0 获取该数据的dom--------------------------------------------

<span v-on:click="choose($event)"></span>

choose:function(event){
    var el = event.currentTarget;
    $(el).find("input").attr("checked","checked")
}

 

vue 2.0版本----》常用代码说明

标签:display   cache   渲染   att   路径   img   one   play   method   

原文地址:http://www.cnblogs.com/liwangxiang/p/6255883.html

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