Coder Social home page Coder Social logo

Comments (11)

phlegx avatar phlegx commented on June 15, 2024 1

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',
  }
})

from vue-sweetalert2.

jordanboston avatar jordanboston commented on June 15, 2024 1

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

from vue-sweetalert2.

jordanboston avatar jordanboston commented on June 15, 2024

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.

from vue-sweetalert2.

harishphk avatar harishphk commented on June 15, 2024

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

from vue-sweetalert2.

picbenoit avatar picbenoit commented on June 15, 2024

Same for me,

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

But the cancel button still is "Cancel".

Is it a bug from last version ?

from vue-sweetalert2.

phlegx avatar phlegx commented on June 15, 2024

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

from vue-sweetalert2.

picbenoit avatar picbenoit commented on June 15, 2024

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);
    }
});

from vue-sweetalert2.

jordanboston avatar jordanboston commented on June 15, 2024

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?

from vue-sweetalert2.

avil13 avatar avil13 commented on June 15, 2024

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

from vue-sweetalert2.

jordanboston avatar jordanboston commented on June 15, 2024

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?

from vue-sweetalert2.

avil13 avatar avil13 commented on June 15, 2024

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

from vue-sweetalert2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.