There are too many wrappers for sweetalert2 for vuejs and most of them does the same thing with less functionality.
Here is how to integrate the default SweetAlert package into VueJS
Install SweetAlert2
add_action( 'init', 'handle_preflight' ); | |
function handle_preflight() { | |
$origin = get_http_origin(); | |
if ( $origin == 'http://localhost:8080' || $origin == 'https://yourapp.firebaseapp.com') { | |
header("Access-Control-Allow-Origin: " . $origin); | |
header("Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE"); |
As I figured out, this question is really only related to beginners in PWA, which don't know that you can (and need) to configure PWA for achieving this. If you feel addressed now (and using VueJS) remember: | |
To automatically download the new content, you need to configure PWA. In my case (VueJS) this is done by creating a file vue.config.js in the root directory of my project (On the same level as package.json). | |
Inside this file you need this: | |
module.exports = { | |
pwa: { |
<?php | |
namespace App\Providers; | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
/** |