3.1.0 • Published 5 years ago

vue-xyh-dialog v3.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

vue 的 dialog 插件

css 动画样式使用的 vivify 动画组件中的部分动画

初始化

从npm下载插件

npm install vue-xyh-dialog

在 main.js 进行引入并初始化

import dialog from 'vue-xyh-dialog';

// 第二个参数传入确认按钮颜色
Vue.use(dialog, '#abcdef');

showLoading(msg);

使用 loading 加载

ParamTypeDescription
msgStringloading 提示语句
<template>
  <div id="app"></div>
</template>

<script>
export default {
  name: 'App',
  mounted() {
    this.$xyhDialog.showLoading('加载中');
  },
};
</script>

<style></style>

avatar

hideloading();

隐藏 loading 动画

<template>
  <div id="app"></div>
</template>

<script>
export default {
  name: 'App',
  mounted() {
    this.$xyhDialog.showLoading('加载中');
    setTimeout(() => {
      this.$xyhDialog.hideLoading();
    }, 2000);
  },
};
</script>

<style></style>

showDialog(options);

toast 弹窗

ParamTypeDescription
{options.title}String标题
{options.msg}String内容
{options.button}String确认按钮文字
{options.type}Number提示类型,0、info 提示 1、success 提示 2、error 提示
{options.close}String|Boolean显示取消按钮或者配置取消按钮内容
{options.duration}Number显示时间,单位是毫秒
{options.callback(res)}Function按钮点击回调,确定点击返回 true,反之返回 false
<template>
  <div id="app"></div>
</template>

<script>
export default {
  name: 'App',
  mounted() {
    const options = {
      title: 'dialog标题',
      msg: 'dialog内容',
      button: '确定',
      type: 0,
      close: true,
      callback(res) {
        console.log(res);
      },
    };
    this.$xyhDialog.showDialog(options);
  },
};
</script>

<style></style>

avatar

出现问题欢迎反馈至https://github.com/xyhxx/toast,谢谢!

3.1.0

5 years ago

3.0.0

5 years ago

2.2.2

5 years ago

2.2.1

5 years ago

2.1.9

5 years ago

2.1.8

5 years ago

2.1.7

5 years ago

1.1.2

5 years ago