【问题标题】:Dialog not apper using v-show使用 v-show 对话框不出现
【发布时间】:2021-06-25 08:16:51
【问题描述】:

我试图弹出一个登录对话框,但即使我将其设置为“真”,我也无法出现问题。下面是我出现在主布局上的两个组件。

登录组件:

<template>
  <div v-show="true">
    <q-dialog>
        <q-card>
          <q-card-section>
            <q-form class="q-gutter-md" style="width: 400px">
              <h4 class="text-h4 text-primary q-my-auto text-weight-medium">Login</h4>
              <q-input
              filled
              :error="state.error"
              label="Your email *"
              lazy-rules
              :rules="[ required, email ]"
              />

              <q-input
                filled
                v-model="state.doc.password"
                :error-message="state.error ? 'Incorrect email or password' : 'Field is Required'"
                :error="state.error"
                :type="state.showPassword ? 'text' : 'password'"
                label="Password *"
                lazy-rules
                :rules="[ required ]">
              </q-input>
            </div>
          </q-form>
        </q-card-section>
      </q-card>
    </q-dialog>
  </div>
</template>

<script>
//import part here...
export default defineComponent({
  setup () {
    //other function here...
})
</script>

其他将登录组件调用为对话框的组件:

<template>
  <LoginComponents />
</template>

<script>
import { defineComponent } from 'vue'
import LoginComponents from 'components/LoginComponents'
export default defineComponent({
  components: {
    LoginComponents
  }
})
</script>

【问题讨论】:

    标签: vue.js vuejs3 quasar


    【解决方案1】:

    q-dialog 需要知道应该显示它。

    这里有如何使用该组件的示例。 https://quasar.dev/vue-components/dialog

    <q-dialog v-model="isShownWhenThisIsTrue">
    

    【讨论】:

    • 那么如何从其他组件调用方法
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-09-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多