• 写过的bug


    const actions={
    updateUsername: ( { commit},value )=>{
    console.log("actions updateUsername");
    commit('updateUsername',value)
    }
    }
    不能这样写{commit,value}


    props传boolean 要用单引号
    componen-title='false'
    双引号会报错 Invalid prop: type check failed for prop "componenTitle". Expected Boolean, got String.
    
    
    ...mapActions传值
    
    Vue组件
    <input @keyup.enter="renovateName(listName)" type="text" v-model="input" placeholder="updateUsername" /> methods:{   ...mapActions(['updateUsername']),   renovateName:function(x){   this.updateUsername(x).then((data)=>{     console.log("Promise resolve:");   console.log(data)   })   } } store/index.js

    const actions={ updateUsername: ( { commit},value )=>{ console.log("actions updateUsername"); console.log(value); return new Promise((resolve, reject) => { setTimeout(() => { commit('updateUsername',value); resolve("2131231") }, 1000) }) } }


     
  • 相关阅读:
    164-268. 丢失的数字
    163-20. 有效的括号
    Sword 30
    Sword 29
    Sword 27
    Sword 25
    Sword 24
    Sword 22
    Sword 21
    Sword 18
  • 原文地址:https://www.cnblogs.com/geekjsp/p/10009476.html
Copyright © 2020-2023  润新知