Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

错误处理模态框封装 #3

Closed
Mistariano opened this issue Apr 11, 2020 · 2 comments · Fixed by #11
Closed

错误处理模态框封装 #3

Mistariano opened this issue Apr 11, 2020 · 2 comments · Fixed by #11
Assignees
Labels
enhancement New feature or request size 1
Projects
Milestone

Comments

@Mistariano
Copy link
Contributor

类似errModal(component, error)的形式,可以令component弹出错误格式化后的提示模态框

@Mistariano Mistariano assigned luo-junyu and unassigned luo-junyu Apr 11, 2020
@Mistariano Mistariano added the enhancement New feature or request label Apr 11, 2020
@Mistariano Mistariano added this to TODO in alpha dev via automation Apr 11, 2020
@Mistariano Mistariano added this to the alpha dev milestone Apr 11, 2020
@luo-junyu
Copy link
Contributor

v0.1 如何弹出错误?

Method 1 : Error Modal (全页面会话式弹窗)

  • import ErrModal from './components/ErrModal';
  • include ErrModal to template
    • <ErrModal
      v-bind:ErrModalStatus="ErrModalStatus"
      v-bind:ErrContent="ErrContent"
      v-bind:ErrTitle="ErrTitle"
      @cancelErrModal="cancelErrModal">
    • Init data:
      ErrModalStatus: false,
      ErrContent: '',
      ErrTitle: '',
  • Add Method: call pushError() to get error modal
    • pushError() {
      this.ErrContent = 'hhh';
      this.ErrTitle = 'ddd';
      this.ErrModalStatus = true;
      },
    • cancelErrModal() {
      window.console.error('[ERROR]: ', this.ErrTitle, this.ErrContent);
      this.modal1 = false;
      window.console.log('updateModal1');
      },

Method 2: Error Message (页面正中小框、可关闭)

直接使用以下代码进行错误消息提示
更改content中内容即可。

this.$Message.error({
              background: true,
              content: 'Error Content',
              duration: 5,
              closable: true,
            });

@Mistariano Mistariano moved this from TODO to WIP in alpha dev Apr 16, 2020
@luo-junyu
Copy link
Contributor

v1.0 如何弹出错误?

引入ErrPush函数

import errPush from './components/ErrPush';
errPush(this, errCode : string, useModal: boolean, errTitle : string, errContent : string);

alpha dev automation moved this from WIP to DONE Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size 1
Projects
No open projects
alpha dev
  
DONE
Development

Successfully merging a pull request may close this issue.

2 participants