mirror of https://github.com/IoTcat/sakura2.git
parent
6dc4eccd56
commit
a11067364d
8 changed files with 89 additions and 20 deletions
@ -1,22 +1,33 @@ |
|||||||
/** |
/** |
||||||
|
* Copyright 2019 Mashiro |
||||||
* @description material-components initial |
* @description material-components initial |
||||||
* @author Mashiro |
* @author Mashiro |
||||||
* @since 19/11/1 |
* @license MIT |
||||||
*/ |
*/ |
||||||
|
|
||||||
import { MDCRipple } from '@material/ripple' |
import { MDCRipple } from '@material/ripple' |
||||||
import { MDCTextField } from '@material/textfield' |
import { MDCTextField } from '@material/textfield' |
||||||
import { MDCTopAppBar } from '@material/top-app-bar' |
import { MDCTopAppBar } from '@material/top-app-bar' |
||||||
|
|
||||||
export default function () { |
export default function () { |
||||||
// const textField = new MDCTextField(document.querySelector('.mdc-text-field'))
|
/* See https://git.io/JegHJ */ |
||||||
|
/* use once (single <HTMLElement>) */ |
||||||
//const ripple = new MDCRipple(document.querySelector('.mdc-button'))
|
// MDCRipple.attachTo(document.querySelector('.mdc-button'))
|
||||||
MDCRipple.attachTo(document.querySelector('.demo-card__primary-action')) |
// const buttonRipple = new MDCRipple(document.querySelector('.mdc-button'))
|
||||||
MDCRipple.attachTo(document.querySelector('.mdc-button')) |
|
||||||
|
|
||||||
// const topAppBar = new MDCTopAppBar(document.querySelector('.mdc-top-app-bar'))
|
/* use to all (map <NodeList>) */ |
||||||
|
// for several classes
|
||||||
|
const rippleList = [] |
||||||
|
rippleList.push('.mdc-button','.demo-card__primary-action', ".something") |
||||||
|
const mdcRipple = [].map.call(document.querySelectorAll(rippleList.join(',')), function (e: any) { |
||||||
|
return new MDCRipple(e) |
||||||
|
}) |
||||||
|
|
||||||
const textField = [].map.call(document.querySelectorAll('.mdc-text-field'), function (el) { |
// for specified class
|
||||||
return new MDCTextField(el) |
const topAppBar = [].map.call(document.querySelectorAll('.mdc-top-app-bar'), function (e: any) { |
||||||
|
return new MDCTopAppBar(e) |
||||||
|
}) |
||||||
|
const textField = [].map.call(document.querySelectorAll('.mdc-text-field'), function (e: any) { |
||||||
|
return new MDCTextField(e) |
||||||
}) |
}) |
||||||
} |
} |
Loading…
Reference in new issue