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

    html inside qdialog

    Framework
    2
    5
    1127
    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.
    • G
      gaguerrero last edited by

      Hello! I need to show html code inside qdialog component (not plugin). In case it is not possible, I need to know how I could adapt the plugin to display an image.
      Thank you for your time!

      beets 1 Reply Last reply Reply Quote 0
      • beets
        beets @gaguerrero last edited by

        @gaguerrero You can easily put anything you want in a qdialog component. Can you explain more your problem?

            <q-dialog v-model="isShowing">
              <q-card>
                <q-card-section>
                  <div class="text-h6">Alert</div>
                </q-card-section>
        
                <q-card-section class="q-pt-none">
                  <q-img src="http://example.com/image.png" />
                </q-card-section>
        
                <q-card-actions align="right">
                  <q-btn flat label="OK" color="primary" v-close-popup />
                </q-card-actions>
              </q-card>
            </q-dialog>
        
        1 Reply Last reply Reply Quote 0
        • G
          gaguerrero last edited by

          Thank you for the answer, I need to show html text that comes from the backend in “strTextoConfirmar” property.
          This is the code

          <q-dialog v-model=“promptConfirmar” html:true persistent>
          <q-card>
          <q-card-section class=“row items-center”>
          <q-avatar>
          <img src="~assets/iconofirma.png">
          </q-avatar>

          	  <q-separator size="1em" color="white"/>			  
          	  <div class="q-ml-sm">{{strTextoConfirmar}}</div>
          	</q-card-section>
          	<q-card-actions align="right">
          	  <q-btn flat label="Cancelar" color="primary" v-close-popup />
          	  <q-btn flat label="Enviar" color="primary" v-close-popup @click="firmar()" />
          	</q-card-actions>
            </q-card>
          </q-dialog>
          1 Reply Last reply Reply Quote 0
          • beets
            beets last edited by

            @gaguerrero If you want to display HTML, you can use:

            	  <div class="q-ml-sm" v-html="strTextoConfirmar"></div>
            

            instead of:

            	  <div class="q-ml-sm">{{strTextoConfirmar}}</div>
            

            Be very careful that the strTextoConfirmar is either not user generated, or sanitized as using v-html can open your app to XSS attacks.

            1 Reply Last reply Reply Quote 0
            • G
              gaguerrero last edited by

              Thank you! It’s what I was looking for

              1 Reply Last reply Reply Quote 0
              • First post
                Last post