Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Styles not working after update #60

Closed
harishphk opened this issue Jun 16, 2019 · 11 comments
Closed

Custom Styles not working after update #60

harishphk opened this issue Jun 16, 2019 · 11 comments

Comments

@harishphk
Copy link

I previously used confirmButtonClass which worked before and not working after the update.

const options = {
	buttonsStyling: false,
	confirmButtonClass: 'btn white-text error',
	cancelButtonClass: 'btn white-text success'
}
Vue.use(VueSweetalert2, options)

I also tried this but still not working:

const options = {
	customClass: {
		confirmButton: 'v-btn white--text success',
		cancelButton: 'v-btn white--text error',
	},
	buttonsStyling: false,
}
Vue.use(VueSweetalert2, options)

What is the issue after update? am i missing something?

@jordanboston
Copy link

I just setup this in my project, and it works fine, but I am also not able to alter anything by passing in the options. Not sure if it needs something else or if it is just broken right now.

@harishphk
Copy link
Author

@jordanboston Yes, that is the issue here. Unable to use options.

@picbenoit
Copy link

Same for me,

Vue.use(VueSweetalert2, {
    cancelButtonText: "Annuler"
});

But the cancel button still is "Cancel".

Is it a bug from last version ?

@phlegx
Copy link

phlegx commented Jun 20, 2019

I have the same problem! @avil13 any idea how to solve this bug? Here the commit that changes the behavior: ecf942c

@picbenoit
Copy link

picbenoit commented Jun 20, 2019

Waiting a correction, you can do like :

window.Swal = require('sweetalert2/dist/sweetalert2.js'); // Without CSS (add it one your sass build)
Vue.use({
    install(Vue, options) {
        let mySwal = Swal.mixin({
            cancelButtonText: "Annuler",
            showCancelButton: true
        });
        Vue.prototype.$swal = mySwal.fire.bind(mySwal);
    }
});

@avil13 avil13 closed this as completed in 34267e8 Jun 26, 2019
@jordanboston
Copy link

I'm wondering if this was a bug and if there is a solid fix for it, since I have not been able to set styles the way the documentation shows to? Any news on this?

@avil13
Copy link
Owner

avil13 commented Jun 26, 2019

Sorry. How do you connect styles? Today I removed this option, and now it is necessary to connect the individual import

@jordanboston
Copy link

jordanboston commented Jun 26, 2019

Like this:

const alertOptions = {
confirmButtonText: 'Confirm',
confirmButtonColor: '#4BAECC',
cancelButtonColor: '#fde06e'
}
// Plugin installation
Vue.use(VueSweetalert2, alertOptions)

I just import and use the plugin, I don't have anything else that is special for style setup. Do I need to?

@avil13
Copy link
Owner

avil13 commented Jun 26, 2019

Need a debug sweetalert library. Now in version v2.1.0 Vue-sweetalert2 this should work. I am again far from the computer, but thanks I need reopen issue

@avil13 avil13 reopened this Jun 26, 2019
@phlegx
Copy link

phlegx commented Jun 27, 2019

Upgrade to v2.1.0 don't solves the problem. I install vue-sweetalert2 with options defined in sweetalert2 v8.x from here sweetalert2.github.io/#configuration:

Vue.use(VueSweetalert2, {
  buttonsStyling: false,
  customClass: {
    confirmButton: 'btn btn-primary',
    cancelButton: 'btn btn-warning',
  }
})

@avil13 avil13 closed this as completed in da55499 Jul 2, 2019
@jordanboston
Copy link

Works for me now in v2.1.1 . --Thanks @avil13 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants