在vuejs中触发功能后,是否可以渲染多组件?

时间:2020-10-30 22:16:30

标签: javascript vue.js components

例如,我创建了一个名为Index.vue的根组件,并注册了这3个Login, Agree and Validation。我要描绘的是,在“登录”中单击submit button后,将显示Agree.vue,当我在“同意”中单击submit button时会依次发生。

我认为我应该使用prop数据在组件之间传递关于每个组件的state,这样可以触发命令以显示所需的组件。但是我应该如何“隐藏”其他组件。我不知道目前是否有一种方法可以在每个Login, Agree, ...

中提交表单
<template>
  <v-app>
    <Login />
    <Agree />
    <Validation />
  </v-app>
</template>

<script>
export default {
  components:{
    Login: () => import('./components/Login'),
    Agree: () => import('./components/Agree-Term')
    Validation: () => import('./components/Validation')
  }
}
</script>

0 个答案:

没有答案