Home Reference Source Repository
public class | source

button

Extends:

src/utils/component.js~Component.default → button

Button

Example:


// default
var button1 = new mdw.Button({
  element: document.body.appendChild(document.createElement('div')),
  text: 'default',
  onClick: function() {
    console.log('button1 click')
  }
})

setTimeout(function() {
  button1.text = 'button1'
}, 1000)

// raised
new mdw.Button({
  element: document.body.appendChild(document.createElement('div')),
  text: 'raised',
  raised: true
})

// default with primary
new mdw.Button({
  element: document.body.appendChild(document.createElement('div')),
  text: 'default with primary',
  primary: true
})

// raised with primary
new mdw.Button({
  element: document.body.appendChild(document.createElement('div')),
  text: 'raised with primary',
  raised: true,
  primary: true
})

// raised with primary
new mdw.Button({
  element: document.body.appendChild(document.createElement('div')),
  type: 'action',
  actionIcon: 'favorite'
})

// disable
new mdw.Button({
  element: document.body.appendChild(document.createElement('div')),
  disable: true,
  text: 'disabled',
})

Constructor Summary

Public Constructor
public

constructor(options: *)

constructor

Member Summary

Public Members
public set

text(text: string): *

Set text

Method Summary

Public Methods
public

render(): void

render DOM elements

Public Constructors

public constructor(options: *) source

constructor

Params:

NameTypeAttributeDescription
options *

Public Members

public set text(text: string): * source

Set text

Public Methods

public render(): void source

render DOM elements

Return:

void