Article From:



The latest project front end uses Vue + elementUI to do this, and errors are reported when using V-IF to judge display elements

[Vue warn]: Error in render: "TypeError: l.$scopedSlots.default is not a function"

This is because when V-for or V-IF switches tags, multiple identical tags are rendered, and reuse occurs if key is not added to distinguish them. Originally, each of these tags is independent, so we need to add keys to distinguish them.

So the solution is to add key to each v-if:
Or change V-IF to v-show

Leave a Reply

Your email address will not be published. Required fields are marked *