From 9f22fc8796ac874e27872abaab3e397ea997111d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=98=86?= Date: Fri, 28 Dec 2018 11:09:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 `componentWillReciveProps` 修改为 `componentWillReceiveProps` 将 `reciveProps` 修改为 `receiveProps` --- packages/taro-weapp/src/component.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/taro-weapp/src/component.js b/packages/taro-weapp/src/component.js index 97ade5788a29..c72c588eae13 100644 --- a/packages/taro-weapp/src/component.js +++ b/packages/taro-weapp/src/component.js @@ -6,10 +6,10 @@ import { } from '@tarojs/taro' import { cacheDataSet, cacheDataGet } from './data-cache' // #组件state对应小程序组件data -// #私有的__componentProps更新用于触发子组件中对应obsever,生命周期componentWillReciveProps,componentShouldUpdate在这里处理 -// #父组件传过来的props放到data.__props中供模板使用,这么做的目的是模拟reciveProps生命周期 +// #私有的__componentProps更新用于触发子组件中对应obsever,生命周期componentWillReceiveProps,componentShouldUpdate在这里处理 +// #父组件传过来的props放到data.__props中供模板使用,这么做的目的是模拟receiveProps生命周期 // 执行顺序:组件setState -> 组件_createData() -> 对应的小程序组件setData(组件更新)-> 子组件的__componentProps.observer执行 -// -> 触发子组件componentWillReciveProps,更新子组件props,componentShouldUpdate -> 子组件_createData -> 子组件setData +// -> 触发子组件componentWillReceiveProps,更新子组件props,componentShouldUpdate -> 子组件_createData -> 子组件setData const PRELOAD_DATA_KEY = 'preload'