No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Vue how to proceed next method on dialog onOK()

    Help
    1
    1
    332
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kaizoku2508 last edited by kaizoku2508

      So, I have this float button which a dialog which notify user to login, upon dialog appear, there are two option -cancel and ok. And I had create login component then I import in this code (i set false to hide). So my plan whenever press ok which go to login component . Since this code made by someone and im still newbie to continue it. Hopefully someone can help code it.

      <template>
        <q-page-sticky position="bottom-right" :offset="[18, 18]">
          <q-btn fab icon="add" color="primary" @click="verifyUser"/>
        </q-page-sticky>
        <q-dialog v-model="state.formDialog" persistent>
          <q-card>
            <NewWord @close="state.formDialog=false" />
          </q-card>
        </q-dialog>
        <LoginComponents v-model='value'/>
      </template>
      
      <script>
      import { defineComponent, reactive } from 'vue'
      import { globalState } from '../util'
      import NewWord from './../pages/NewWord'
      import { Dialog } from 'quasar'
      import LoginComponents from 'components/LoginComponents'
      export default defineComponent({
        components: {
          NewWord,
          LoginComponents
        },
        setup () {
          const state = reactive({
            showDialog: false,
            formDialog: false
          })
      
          function verifyUser () {
            console.log(globalState)
            if (globalState.auth) {
              state.formDialog = true
            } else {
              Dialog.create({
                cancel: true,
                persistent: true,
                title: 'Login required',
                message: 'We love that you want to contribute to our cause. Please login to proceed. Thank you so much!.'
              }).onOk(() => {
                console.log('go to login')
              })
            }
          }
      
          return {
            state,
            verifyUser
          }
        },
        data () {
          return {
            value: false
          }
        }
      })
      </script>
      
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post