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 |
Method Summary
Public Methods | ||
public |
render(): void render DOM elements |