Components in slot in mpvue cannot be parsed

clipboard.png

The HTML within this Test component in

mpvue uses slot slot distribution, where HTML uses an array arr loop to create multiple < One > components.

if the array arr has data when the parent component is rendered at the beginning, there is no problem with the created One component. However, if the parent component starts the arr array with no data, but creates data for arr after a certain period of time through ajax or setTimeout, and then loops, then the created One component is not parsed, only its HTML content, and its js data and behavior are not parsed and processed. This is probably because the Test component slot content has been parsed in advance, and the components added since then can no longer be parsed. How to solve this problem.

Jul.22,2021

you can try v-if to delay rendering div .

Menu