1.6.0 • Published 6 years ago

v-vue-alert v1.6.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

v-vue-alert

Requirements

Installation

# npm
$ npm install v-vue-alert

$ npm run dev

Usage

inside the file /src/main.js

import Vue from 'vue'
import VAlert from 'v-vue-alert'
import App from './App'

Vue.use(VAlert)

new Vue({
  el: '#app',
  template: '<App/>',
  components: { App }
})

For an example of functionality

inside the file /src/App.vue

<template>
    <div id="app">
        <vue-alert></vue-alert>
        <vexample></vexample>
    </div>
</template>

<script>
import Vexample from './Vexample'

export default {
  components: {
    Vexample
  },
  mounted () {
    this.$alert.success({ message: 'Component mounted!' })
  }
}
</script>

<style>
.vue-alert {
  margin-top: 10px;
}
</style>

Create sample component
Vexample.vue

<template>
  <div>
    <h1>Example component</h1>
    <button class="btn btn-default" @click="showAlert">v-vue-alert</button>
  </div>
</template>

<script>
export default {
  methods: {
    showAlert () {
      this.$alert.show({
        message: 'Clicked the button!'
      })
    }
  }
}
</script>

License

The MIT License

1.6.0

6 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago