Avoid mutating a prop directly since the value will be overwritten

前端 未结 11 899
被撕碎了的回忆
被撕碎了的回忆 2020-12-10 01:07

I have very common problem with upgrading to Vue 2.0

I am getting warning:

Avoid mutating a prop directly since the value will be overwritte

11条回答
  •  暖寄归人
    2020-12-10 01:57

    var GuestMenu = Vue.extend({
       props : {
        uNpW:{type:Object}
       }
          template: `
            
    `, });
    App = new Vue ({ 
       el: '#app',
      data: 
        {
          topMenuView: "guestmenu",
          contentView: "guestcontent",
          unAndPw:{username: "",password: ""}
    
        }
    })
    
    in main html
     
    

    you dont need emit or any other thing

提交回复
热议问题