From ee67334bfa084a56b50d66ae4332c6bffa622932 Mon Sep 17 00:00:00 2001 From: yuche Date: Tue, 13 Aug 2019 15:59:27 +0800 Subject: [PATCH] =?UTF-8?q?refactor(transformer):=20=E5=BF=AB=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E7=BB=84=E4=BB=B6=E6=A0=B9=E7=BB=84=E4=BB=B6=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=20if=20=E5=B1=9E=E6=80=A7=20if:=20priTaroCompReady?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-transformer-wx/src/create-html-element.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/taro-transformer-wx/src/create-html-element.ts b/packages/taro-transformer-wx/src/create-html-element.ts index fae5017a45cb..df589581aeda 100644 --- a/packages/taro-transformer-wx/src/create-html-element.ts +++ b/packages/taro-transformer-wx/src/create-html-element.ts @@ -85,6 +85,13 @@ export const createHTMLElement = (options: Options, isFirstEmit = false) => { } } } + + if (isFirstEmit && name === 'div' && !transformOptions.isRoot) { + options.attributes = { + ...options.attributes, + 'if': '{{priTaroCompReady}}' + } + } } const isVoidTag = voidHtmlTags.has(options.name)