import { tag, WeElement, h, extractClass } from 'omi' import * as css from './index.scss' import { MDCRipple } from '@material/ripple' import '../icon' //@ts-ignore import '../theme.ts' interface Props { items: any[] } interface Data { } @tag('m-bottom-nav') export default class BottomNav extends WeElement{ static css = css static defaultProps = { } static propTypes = { selectedColor: String, items: Array } installed() { this.shadowRoot.querySelectorAll('.ripple').forEach(dom => { new MDCRipple(dom) }) } clickHandler = (item) => { this.fire('itemclick', item) if (!item.selected) { this.props.items.forEach(_ => _.selected = false) item.selected = true this.fire('change', item) this.update(true) } } render(props) { return
{props.items.map((item,index) => ( ))}
} }