Vue Js open sketchpad in vue-js-modal

Posted 5 months ago by bhavuksuthar

I am new with Vue and trying to open sketchpad inside vue-js-modal.

I am not sure what am I doing wrong here.

I am using VueModal and vue-signature-pad.

It works fine on the page but I could not make it run in the modal.

Here is the link to codesandbox

App.vue code is as follow

<template>
  <div id="app">
    <v-dialog />
    <div class="container">
      <div class="row">
        <div class="col-12 mt-2">
          <div class="col-6 mt-2">
            <button class="btn btn-secondary" @click="showButtonsDialog">
              Open Dialog
            </button>
          </div>
        </div>
       <div class="col-12 mt-2">
          <VueSignaturePad
            id="signature"
            width="100%"
            height="100%"
            ref="signaturePad"
          />
        </div>            
      </div>
    </div>
  </div>
</template>

<script>
    export default {
    name: "App",
    methods: {
       showButtonsDialog() {
           this.$modal.show("dialog", {
           title: "Some Title",
           text:'<VueSignaturePad id="signature" width="100%" height="200px" ref="signaturePad"/>',
           buttons: [
           {
               title: "CANCEL",
               handler: () => {
                   this.$modal.hide("dialog");
               }
           }]
          });
        }
      }
    };    
</script>

What am I doing wrong here?

Thank you

Please sign in or create an account to participate in this conversation.