0👍
✅
Looks like there is an issue with quotes in the template.
Working Demo :
let app = Vue.createApp({
data() {
return {
greeting : 'hello VUE',
}
}
})
app.component ('login-form',{
template: `<form @submit="handleSubmit">
<h1> {{ title }} </h1>
<input type="email" />
<input type="password" />
<button>Log In</button>
</form>`,
data() {
return {
title:'Login Form'
}
},
methods:{
handleSubmit(){
console.log('submitted')
}
}
})
app.mount('#app')
<script src="https://unpkg.com/vue@next"></script>
<div id="app" v-cloak>
<login-form />
</div>
Source:stackexchange.com