Skip to content

lxper/vue-alert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vue-alert

引入

把内容放在一个文件夹里,然后在main.js中引入

import Vue from 'vue'
import App from './App.vue'
import Alert from './alert/alert'

Vue.config.productionTip = false;
Vue.prototype.$Alert = Alert;

new Vue({
  render: h => h(App),
}).$mount('#app')

调用

this.$Alert.info({
      content: 'success',
      duration: 3,
      type: 'success',
      icon: 'http://129.204.88.180/wp-content/uploads/2019/03/success.png'
    });
    this.$Alert.info({
      content: 'warn',
      duration: 3,
      type: 'warn',
      icon: 'http://129.204.88.180/wp-content/uploads/2019/03/warn.png'
    });
    this.$Alert.info({
      content: 'fail',
      duration: 3,
      type: 'fail',
      icon: 'http://129.204.88.180/wp-content/uploads/2019/03/fail.png'
    });

效果

About

Vue全局alert

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published