Skip to content

elementPlus相关(LJSEl)

说明

elementPlus相关(LJSEl),V3JS框架中常用的基础库。

1.ElMessageBox封装

用于删除时的提示框。

方法:delMessageBox(params: Object)

示例
js
this.$LJSEl.delMessageBox({
  title: '系统提示1',
  message: `是否确认删除的数据项?`,
  doSomething: () => {
    this.$store.commit('loadingStore', {
      tag: true,
      text: '删除中....'
    });
    listDel(ids).then((res) => {
      if (res.code === 200) {
        this.getList();
        this.$modal.msgSuccess('删除成功');
      }
      this.$store.commit('loadingStore', {
        tag: false,
        text: '删除中....'
      });
    }).catch(()=>{
      this.$store.commit('loadingStore', {
        tag: false,
        text: '删除中....'
      });
    });
  }
});

参数

参数类型必填默认值说明
o.typeString×warning提示框类型,适用ElMessageBox属性type。
o.iconstring / Component×''自定义图标组件,会覆盖 type 的类型。
o.titleString×系统提示提示框标题。
o.messageString提示框内容。
o.showCancelButtonBoolean×true是否显示取消按钮。
o.confirmButtonTextString×确定确定按钮的文本内容。
o.cancelButtonTextString×取消取消按钮的文本内容。
o.center 0.7.2Boolean×false是否居中布局。
o.draggable 0.7.2Boolean×falseMessageBox 是否可拖放。
o.overflow 0.7.2el 2.5.4Boolean×falseMessageBox 拖动范围可以超出可视区。
o.appendTo 0.7.2el 2.2.19string / HTMLElement×设置组件的根元素。
o.customStyleObject×ElMessageBox属性custom-style。
o.doSomethingFunction×确定后做什么事情。