我对Vue有点陌生,对我来说越来越难破解了。我正在使用Vue 3,我想使用vue - form在我的vue应用程序上创建一个注册表单。以下是我遵循Vue格式的官方文档的进展情况:
// main.js
import { createApp } from 'vue'
import App from './App.vue'
import VueFormulate from '@braid/vue-formulate'
createApp(App).use(VueFormulate).mount('#app')然后在Register.vue上:
<template>
<formulate-form v-model="formValues" @submit="registerUser">
<formulate-input name="first_name" label="First Name" placeholder="First Name" type="text"></formulate-input>
</formulate>
</template>
<script>
export default {
name: 'RegisterLogin',
methods: {
registerUser () {
// call back here
}
}
}
</script>但是我得到了Vue警告:未能解决组件: from和Vue警告:未能解决组件:来自控制台的格式输入错误,表单拒绝呈现。我真的说不出原因。这里的答案是:[Vue warn]: Failed to resolve component: Step1Item:也帮不上忙。
发布于 2020-11-23 06:03:42
我不得不创建自己的表单组件,因为我无法解决这个问题。
发布于 2021-04-28 10:17:22
在Register.vue中,导入正在使用的所有组件:
import { FormulateForm, FormulateInput } from '@braid/vue-formulate';然后在导出方法中尝试添加components对象,并列出您正在使用的所有组件的名称,如下所示:
export default {
components: {
FormulateForm,
FormulateInput,
another-component-here
},
* the rest of the code here *
}https://stackoverflow.com/questions/64848002
复制相似问题