现有 自定义组件location 内容如下。有循环加载的子组件 location-panel, 通过 this.selectComponet("#prefix-0") 的方式无法取,有什么思路没有
<block>
<template name="tpt">
<block wx:for="{{ops}}" wx:key="*this">
<location-panel id="prefix-{{index}}"/>
</block>
</template>
<template is="tpt"></template>
</block>
<template class="tpt"> <block wx:for="{{ops}}" wx:key="*this"> <location-panel id="prefix-{{index}}"/> </block> </template>
试下这样
this.selectComponent('.tpt')
若认为该回答有用,给回答者点个[ 有用 ],让答案帮助更多的人