in the vue project, you have the following code:
<div ref="warePage">
<sub-products-setting id="floor_0" v-if="pSubProductInfoVO.isShow" ref="subProductsRef"></sub-products-setting>
<basic-info id="floor_1" v-if="pBasicInfoVO.isShow" ref="basicInfoRef"></basic-info>
<sku-info id="floor_2" v-if="pSkuInfoListVO.isShow" ref="skuInfosRef"></sku-info>
<product-imgs id="floor_3" v-if="pProductImgInfoVO.isShow" ref="productImgRef"></product-imgs>
<delivery-info id="floor_4" v-if="pDeliveryInfoVO.isShow" ref="deliveryInfoRef"></delivery-info>
<ware-house id="floor_5" v-if="pWarehouseInfoVO.isShow" ref="warehouseRef"></ware-house>
<description-info id="floor_6" v-if="pDescriptionsInfoVO.isShow" ref="descriptionRef"></description-info>
<account-info id="floor_7" v-if="pManAccountVO.isShow" ref="accountInfoRef"></account-info>
<ordiary-info id="floor_8" v-if="pOrdinaryAttrInfoVO.isShow" ref="ordinaryInfoRef"></ordiary-info>
<!---->
<business-relate id="floor_9" v-if="pBusinessRelateInfoVO.isShow && !isVirtualSuitWare" ref="businessInfoRef"></business-relate>
</div>
then traverse in created:
created() {
//
window.addEventListener("scroll", function () {
console.log(typeof self.$refs.warePage.children)
self.$refs.warePage.children.forEach((floor, index) => {
// if (winHeight + scrollHeight - $(floor).offset().top > winHeight / 2) {
console.log("activeIndex--->" + index)
// }
})
}, false)
}
:
object
:
self.$refs.warePage.children:
May I ask what the reason is? I need to traverse ref for warePublishPage under the children how to deal with?