فهرست منبع

refactor: keep single source of truth (#8334)

X.L 7 سال پیش
والد
کامیت
6eaf56e28d
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      src/core/instance/state.js

+ 1 - 1
src/core/instance/state.js

@@ -86,7 +86,7 @@ function initProps (vm: Component, propsOptions: Object) {
         )
       }
       defineReactive(props, key, value, () => {
-        if (vm.$parent && !isUpdatingChildComponent) {
+        if (!isRoot && !isUpdatingChildComponent) {
           warn(
             `Avoid mutating a prop directly since the value will be ` +
             `overwritten whenever the parent component re-renders. ` +