Преглед на файлове

use more descriptive function names

Evan You преди 10 години
родител
ревизия
0c6c748d9d
променени са 2 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 3 3
      src/runtime/instance/render.js
  2. 1 1
      src/runtime/vdom/component.js

+ 3 - 3
src/runtime/instance/render.js

@@ -40,7 +40,7 @@ export function renderMixin (Vue) {
     }
   }
 
-  Vue.prototype._tryUpdate = function (parentData, children, key) {
+  Vue.prototype._updateFromParent = function (parentData, children, key) {
     const oldParentData = this.$options._renderData
     this.$options._renderKey = key
     this.$options._renderData = parentData
@@ -54,7 +54,7 @@ export function renderMixin (Vue) {
     }
     // diff parent data (attrs on the placeholder) and queue update
     // if anything changed
-    if (diffParentData(parentData, oldParentData)) {
+    if (parentDataChanged(parentData, oldParentData)) {
       this.$forceUpdate()
     }
   }
@@ -123,7 +123,7 @@ function resolveSlots (vm, children) {
   }
 }
 
-function diffParentData (data, oldData) {
+function parentDataChanged (data, oldData) {
   const keys = Object.keys(oldData)
   let key, old, cur, i, l, j, k
   for (i = 0, l = keys.length; i < l; i++) {

+ 1 - 1
src/runtime/vdom/component.js

@@ -45,7 +45,7 @@ function prepatch (oldVnode, vnode) {
     cur.child = old.child
     // try re-render child. the child may optimize it
     // and just does nothing.
-    old.child._tryUpdate(cur.data, cur.children, vnode.key)
+    old.child._updateFromParent(cur.data, cur.children, vnode.key)
   }
 }