How to use the @material/top-app-bar.MDCTopAppBar function in @material/top-app-bar

To help you get started, we’ve selected a few @material/top-app-bar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Tencent / omi / packages / omim / src / top-app-bar / index.tsx View on Github external
updated() {
    this.topAppBar.destroy()
    this.topAppBar = new MDCTopAppBar(this.shadowRoot.querySelector('.mdc-top-app-bar'))

    // Get the target scrollbar of 'm-top-app-bar' and trigger the animation based on this scrollbar (JSX use) (获取 'm-top-app-bar' 的目标滚动条,根据此滚动条触发动画)
    if(this.props.scrollTarget) {  //(JSX 使用)
      this.topAppBar.setScrollTarget(this.props.scrollTarget)
    } else { // (原生 js 使用)
      if(this.props.scrollTargetId) {
        const findTarge = document.querySelector('#' + this.props.scrollTargetId)
        findTarge ? this.topAppBar.setScrollTarget(findTarge) : this.topAppBar.setScrollTarget(window)
      } else {
        this.topAppBar.setScrollTarget(window)
      }
    }
  }
github prateekbh / preact-material-components / TopAppBar / TopAppBar.jsx View on Github external
componentDidMount() {
    this.MDComponent = new MDCTopAppBar(this.control);
    this.MDComponent.listen('MDCTopAppBar:nav', this._onNav);
  }
  componentWillUnmount() {
github prateekbh / preact-material-components / ts / TopAppBar / index.tsx View on Github external
public componentDidMount() {
    super.componentDidMount();
    if (this.control) {
      const comp = new MDCTopAppBar(this.control);
      comp.listen('MDCTopAppBar:nav', this.onNav);
      this.MDComponent = comp;
    }
  }
github springtype-org / springtype / src / packages / material-ui / src / component / mwc-top-bar / mwc-top-bar.tsx View on Github external
onBeforeFlow() {
        const topAppBarElement = this.querySelector('.mdc-top-app-bar');
        if (topAppBarElement) {
           this.mwcInstance = new MDCTopAppBar(topAppBarElement);
        }
    }
}
github mashirozx / sakura2 / src / ts / components / MDCHandler.ts View on Github external
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) {
github Tencent / omi / packages / omim / src / top-app-bar / index.tsx View on Github external
installed() {
    this.topAppBar = new MDCTopAppBar(this.shadowRoot.querySelector('.mdc-top-app-bar'))

    domReady(() => {
      this._setChildrenAttribute()
      this.update()
    })
  }