I have a form created in vue and added to a blade page.
app.js
new Vue({
router,
components: {
'advice-form': AdviceForm,
}
}).$mount('#app');
blade.php
<div class="my-6">
<advice-form></advice-form>
</div>
AdviceForm Component
<template>
<input
class="md:w-auto w-full"
type="text"
name="name"
id="name"
placeholder="Full name"
v-model="name"
/>
</template>
<script>
export default {
name: "AdviceForm",
methods: {
data() {
return {
name: ''
};
}
}
};
</script>
When I try to add v-model for inputs I get an error saying Property or method "name" is not defined on the instance but referenced during render.
I am sure the name
is defined in the data property. Also, the <advice-form></advice-form>
is placed within the #app div in blade page.
Can anyone help me figure out what is the problem?