vue-sample-swalert

1.1.3 • Public • Published

vue-simple-swalert

swalert组件,适用于uni-app。

说明

项目说明 样式引用项目 wepy-simple-toast

使用

安装组件

  npm i vue-sample-swalert

引入

// main.js 全局引入
import swalert from 'vue-simple-swalert';
Vue.component('swalert',swalert);

// template
<template>
  <view>
  
    //这里是你的页面内容...
    <swalert ref="swalert"/> //注意 ref
  </view>
</template>

<script>

export default {
  //
  methods: { 
	  // args1 => title ,标题内容
	  // args2 => Object , 可以定义对象
	  this.$openSwalert("title", { showIcon: true , ... })
  }
 }
</script>

调用方法

	// 全局方法
	this.$openSwalert(title, options);
	this.$successSwalert(title, options);
	this.$errorSwalert(title, options);
	this.$hideSwalert(title, options);
	
  1. options 参数当前只有 showIcon,showCloseBar,showClose,showBtn,showConfirm等等可用

Readme

Keywords

none

Package Sidebar

Install

npm i vue-sample-swalert

Weekly Downloads

1

Version

1.1.3

License

MIT

Unpacked Size

7.9 kB

Total Files

3

Last publish

Collaborators

  • cleveng