Godofbrowser/vuejs-dialog

Is there a simple way to set dialog width?

symonsoft opened this issue · 3 comments

Something like:

Vue.use(VuejsDialog, {
  dialogWidth: "300px"
})

@symonsoft I wouldn't recommend setting a fixed width, but you can do that with css.

I would recommend you set max-width instead... you can add this to the head tag.

  .dg-main-content {
    max-width: 300px;
  }

If you want to set custom width for a specific instance, you can use the custom class option like so:

let options = {
    customClass: 'my-small-width-class' // Custom class to be injected into the parent node for the current dialog instance
};
this.$dialog.confirm('yes or no?', options)

Then your css becomes:

  .my-small-width-class .dg-main-content {
    max-width: 300px;
  }

Will it work?

Vue.use(VuejsDialog, {
  customClass: 'my-small-width-class'
})

Yeah, that should work too 👍