模态对话框通过遮罩层来阻止用户的其他行为。

  1. var component = new NEKUI.Component({
    template: template,
    show: function() {
    var modal = new NEKUI.Modal({
    data: {
    lang: 'en-US',
    content: 'Modal内容'
    }
    });
    }
    });

Disable

模态框 modal - 图2

  1. <button class="u-btn u-btn-primary" on-click={this.show()}>Modal</button>
  1. var component = new NEKUI.Component({
    template: template,
    show: function() {
    var modal = new NEKUI.Modal({
    data: {
    lang: 'en-US',
    okDisabled: true,
    cancelDisabled: true,
    cancelButton: true,
    content: 'Modal内容'
    }
    });
    }
    });

  1. var component = new NEKUI.Component({
    template: template,
    show: function() {
    var modal = new NEKUI.Modal({
    data: {
    lang: 'en-US',
    hasFooter: false,
    content: 'Modal内容'
    }
    });
    }
    });

禁止关闭

  1. <button class="u-btn u-btn-primary" on-click={this.show()}>Modal</button>
  1. var component = new NEKUI.Component({
    template: template,
    show: function() {
    var modal = new NEKUI.Modal({
    data: {
    lang: 'en-US',
    isCanClose: false,
    content: 'Modal内容'
    }
    });
    }
    });

模态框 modal - 图5

  1. var component = new NEKUI.Component({
    template: template,
    show: function() {
    NEKUI.Modal.alert('Alert内容');
    }
    });

Confirm

  1. <button class="u-btn u-btn-success" on-click={this.show()}>Confirm</button>
  1. var component = new NEKUI.Component({
    template: template,
    show: function() {
    NEKUI.Modal.confirm('Confirm内容');
    }
    });

API

Classes

Functions

Modal

Kind: global classExtend: Component

config()

init()

Kind: global functionAccess: protected

Kind: global functionAccess: public

ok() 确定对话框() ⇒ void

Kind: global functionAccess: public

cancel() 取消对话框() ⇒ void

Kind: global functionAccess: public

“close 关闭对话框时触发”

Kind: event emittedProperties

Kind: event emitted

“cancel 取消对话框时触发”