vue.js 学习第一天:v-if用法,@click切换以及过滤器使用和计算

input{ border: 1px solid # ddd;}.vueList{width: 400px;margin: 20px 0;}.vueList li{display: flex;}.vueList li span{flex: 1;display: block;}输入您的姓名:欢迎点击退出登录您的姓名:您的密码:登录var v = new Vue({el : '












  input{ border: 1px solid # ddd;}
  .vueList{
    width: 400px;
    margin: 20px 0;
  }
  .vueList li{
    display: flex;
  }
  .vueList li span{
    flex: 1;
    display: block;
  }



    输入您的姓名:
    欢迎点击
    退出登录



    您的姓名:
    您的密码:
    登录




var v = new Vue({
  el : '# vueInstance',
  data : {
    name : 'bobobo',
    loginStatus : false
  },
  methods : {
    say : function(){
      console.log("欢迎" + this.name)
    },
    switchLoginStatus : function(){
      this.loginStatus = !this.loginStatus;
    }
  }
});
console.log(v.name)




      1.         序号
        价格
        单位
        总价:{{ sum }}



        {{ index + 1 }}
        {{ listCurrent.price }}
        {{ listCurrent.num }}
        总价:{{ msg | discount listCurrent.price listCurrent.num }}




  var listCurrent = {
    price:'', num:''
  };
  var list = [
    { price:100, num:4 },
    { price:110, num:14 },
    { price:102, num:24 },
    { price:140, num:34 },
    { price:105, num:44 }
  ];

  var vm = new Vue({
    el : '.vueList',
    data : {
      listCurrent : listCurrent,
      list: list
    },
    computed : {
      sum : function(){
        var result = 0;
        for (var i=0; i

关键字:vue.js, JavaScript, ice, 总价