Jelajahi Sumber

fixed web component internal index always set to 0

Gildas 6 tahun lalu
induk
melakukan
14a8a8c745
1 mengubah file dengan 1 tambahan dan 2 penghapusan
  1. 1 2
      lib/single-file/util/doc-helper.js

+ 1 - 2
lib/single-file/util/doc-helper.js

@@ -129,9 +129,8 @@ this.docHelper = this.docHelper || (() => {
 	}
 
 	function getShadowRootContents(elementsInfo) {
-		let shadowRootContents;
+		let shadowRootContents, elementIndex = 0;
 		elementsInfo.forEach((elementInfo, element) => {
-			let elementIndex = 0;
 			if (element.attributes && elementInfo.shadowRoot) {
 				element.setAttribute(SHADOW_ROOT_ATTRIBUTE_NAME, elementIndex);
 				elementIndex++;