You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Start the stackblitz app, and verify that the <form> element is not rendered
What is expected?
The component to be rendered properly
What is actually happening?
The <form> element within HelloWorld.vue component's template is not rendered and the following warn is shown in browser console:
[Vue warn]: Failed to mount component: template or render function not defined.
found in
---> <Anonymous>
<HelloWorld> at /home/projects/node-lwlnmc/src/components/HelloWorld.vue
<Root>
This happens when we use a reactive property within <script setup> with the same name as an HTML element that exists within <template> In this case we use form reactive property and a <form> element. The same would happen if we had named our reactive property, for instance, div
// HelloWorld.vue
<scriptsetuplang="ts">import { reactive } from'vue'const form =reactive({ foo: 'bar',})</script>
<template>
<div>
<form> <!-- This is not rendered -->
<inputv-model="form.foo" />
</form>
</div>
</template>
If we change the name of the form reactive property to something else (e.g myForm) the <form> will be rendered as expected.
// HelloWorld.vue
<scriptsetuplang="ts">import { reactive } from'vue'const myForm =reactive({ foo: 'bar',})</script>
<template>
<div>
<form> <!-- This will be rendered as expected -->
<inputv-model="myForm.foo" />
</form>
</div>
</template>
The text was updated successfully, but these errors were encountered:
Version
2.7.6
Reproduction link
stackblitz.com
Steps to reproduce
Start the stackblitz app, and verify that the
<form>
element is not renderedWhat is expected?
The component to be rendered properly
What is actually happening?
The
<form>
element withinHelloWorld.vue
component's template is not rendered and the following warn is shown in browser console:This happens when we use a reactive property within
<script setup>
with the same name as an HTML element that exists within<template>
In this case we useform
reactive property and a<form>
element. The same would happen if we had named our reactive property, for instance,div
If we change the name of the
form
reactive property to something else (e.gmyForm
) the<form>
will be rendered as expected.The text was updated successfully, but these errors were encountered: