Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to use sweet alert in vue js

npm install -S vue-sweetalert2
// Main Js
import Vue from 'vue'
import VueSweetalert2 from 'vue-sweetalert2';
import App from './App.vue';

Vue.use(VueSweetalert2);

new Vue({
  el: '#app',
  render: h => h(App)
});

// app.vue
<template>
  <!-- button used to trigger event -->
  <button v-on:click="alertDisplay">Click me</button>
</template>

<script>
  export default {
    data() {
      return {
        text: ''
      }
    },
    methods: {
      alertDisplay() {
        // $swal function calls SweetAlert into the application with the specified configuration.
        this.$swal('Heading', 'this is a Heading', 'OK');
      }
    }
  }
<script>
Comment

sweetalert npm in vuejs

npm install -S vue-sweetalert2
Comment

sweet alert vue js laravel

swal(...
Comment

PREVIOUS NEXT
Code Example
Javascript :: check if number is single digit javascript 
Javascript :: js save files 
Javascript :: inline style in nextjs 
Javascript :: getters in nuxt vuex acccessing 
Javascript :: angular add font 
Javascript :: apa itu this pada javascript 
Javascript :: javascript create element in a new line 
Javascript :: js alphabets array 
Javascript :: sleep function js 
Javascript :: local storage javascript 
Javascript :: vue chart nuxt 
Javascript :: js keydown only once 
Javascript :: moment to date 
Javascript :: express ejs layout use different layout 
Javascript :: express get query params from url 
Javascript :: js import export es5 
Javascript :: npm install run audit fix 
Javascript :: get element font size javascript 
Javascript :: multiple transform properties javascript 
Javascript :: how to display text with formating react js 
Javascript :: Module Error (from ./node_modules/eslint-loader/dist/cjs.js): 
Javascript :: react image compression 
Javascript :: router navigatebyurl 
Javascript :: elevation react native 
Javascript :: jquery click hold down 
Javascript :: adding media queries in makeStyle material react 
Javascript :: TypeError: MiniCssExtractPlugin is not a constructor 
Javascript :: angular create guard 
Javascript :: react native run on device command line 
Javascript :: how to convert array to uppercase in javascript 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =