From 4513f03ac1d9a9d8be9ed2d4288ea92d65720977 Mon Sep 17 00:00:00 2001 From: "xuanji.w" Date: Wed, 24 Feb 2021 15:39:37 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=B0=83=E6=95=B4=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/vision-polyfill/src/bundle/bundle.ts | 4 ++-- .../tests/prototypeWrapper/index.js | 24 ------------------- 2 files changed, 2 insertions(+), 26 deletions(-) delete mode 100644 packages/vision-polyfill/tests/prototypeWrapper/index.js diff --git a/packages/vision-polyfill/src/bundle/bundle.ts b/packages/vision-polyfill/src/bundle/bundle.ts index b969512d9..2554101b4 100644 --- a/packages/vision-polyfill/src/bundle/bundle.ts +++ b/packages/vision-polyfill/src/bundle/bundle.ts @@ -44,7 +44,7 @@ function registerPrototypeViewWrapper(name: string, prototypeViewWrapper: Functi } } -function wrapperPrototypeView(view: ComponentClass) { +function wrapPrototypeView(view: ComponentClass) { const newView = prototypeViewWrapperList.reduce((acc, { prototypeViewWrapper }) => { return prototypeViewWrapper(acc.displayName, acc) || acc; }, view); @@ -200,7 +200,7 @@ export default class Bundle { viewDetail.displayName = getCamelName(viewName || item.name); } (viewDetail as any)._packageName_ = viewName || item.name; - this.viewsMap[viewDetail.displayName] = wrapperPrototypeView(viewDetail); + this.viewsMap[viewDetail.displayName] = wrapPrototypeView(viewDetail); }); } diff --git a/packages/vision-polyfill/tests/prototypeWrapper/index.js b/packages/vision-polyfill/tests/prototypeWrapper/index.js deleted file mode 100644 index 4b64e8ce5..000000000 --- a/packages/vision-polyfill/tests/prototypeWrapper/index.js +++ /dev/null @@ -1,24 +0,0 @@ -// const { Bundle } = window.VisualEngine; -// Bundle.registerPrototypeConfigPreprocessor('aaa', (componentName, config) => { -// if (componentName === 'Text') { -// config.configure[0].initialValue.zh_CN = 'XXXXXXXXXX'; -// return { -// ...config, -// }; -// } -// }); - -// Bundle.registerPrototypeViewWrapper('aaa', function (componentName, View) { -// return componentName === 'Text' -// ? class Wrapper extends window.React.Component { -// render() { -// return ( -//
-// -//
AAAAAA
-//
-// ); -// } -// } -// : null; -// });