From 1d461d5c3bd0750c98d7a723c9b91eb640976762 Mon Sep 17 00:00:00 2001 From: chenjiajian <798095202@qq.com> Date: Fri, 7 May 2021 10:15:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(api):=20=E4=BF=AE=E5=A4=8D=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E4=B8=8D=E5=88=B0=20Taro.preload=20=E9=A2=84=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=95=B0=E6=8D=AE=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?fix=20#9175?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-api/src/index.js | 2 +- packages/taro-api/src/tools.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/taro-api/src/index.js b/packages/taro-api/src/index.js index c9ab54e57219..7718bc84726a 100644 --- a/packages/taro-api/src/index.js +++ b/packages/taro-api/src/index.js @@ -64,7 +64,7 @@ const Taro = { } Taro.initPxTransform = getInitPxTransform(Taro) -Taro.preload = getPreload(Taro) +Taro.preload = getPreload(Current) Taro.pxTransform = getPxTransform(Taro) export default Taro diff --git a/packages/taro-api/src/tools.js b/packages/taro-api/src/tools.js index 9d1b9bcdd75b..337d62167dce 100644 --- a/packages/taro-api/src/tools.js +++ b/packages/taro-api/src/tools.js @@ -2,12 +2,12 @@ export function Behavior (options) { return options } -export function getPreload (taro) { +export function getPreload (current) { return function (key, val) { if (typeof key === 'object') { - taro.preloadData = key + current.preloadData = key } else if (key !== undefined && val !== undefined) { - taro.preloadData = { + current.preloadData = { [key]: val } }