Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders.
這個錯誤是因為,因為我們直接修改父組件傳遞過來的參數,這樣會存在影響外部 組件的風險。
解決方案:
在組件內部再構建一套屬性域,來存儲父組件傳遞過來的參數,從而與外界解耦
Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders.
這個錯誤是因為,因為我們直接修改父組件傳遞過來的參數,這樣會存在影響外部 組件的風險。
解決方案:
在組件內部再構建一套屬性域,來存儲父組件傳遞過來的參數,從而與外界解耦
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。