Godofbrowser / vuejs-dialog

A lightweight, promise based alert, prompt and confirm dialog
MIT License
351 stars 111 forks source link

Is there a simple way to set dialog width? #40

Open symonsoft opened 6 years ago

symonsoft commented 6 years ago

Something like:

Vue.use(VuejsDialog, {
  dialogWidth: "300px"
})
Godofbrowser commented 6 years ago

@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;
  }
symonsoft commented 6 years ago

Will it work?

Vue.use(VuejsDialog, {
  customClass: 'my-small-width-class'
})
Godofbrowser commented 6 years ago

Yeah, that should work too 👍