How to use the onsenui.platform function in onsenui

To help you get started, we’ve selected a few onsenui 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 ryanelian / instapack / templates / vue-mobile / client / js / index.ts View on Github external
import 'ts-polyfill/lib/es2016-array-include';
import 'ts-polyfill/lib/es2017-object';
import 'ts-polyfill/lib/es2017-string';
import 'ts-polyfill/lib/es2018-async-iterable';   // for-await-of
import 'ts-polyfill/lib/es2018-promise';
import 'ts-polyfill/lib/es2019-array';
import 'ts-polyfill/lib/es2019-object';
import 'ts-polyfill/lib/es2019-string';
import 'ts-polyfill/lib/es2020-string';

import ons from 'onsenui';

if (ons.platform.isIPhoneX()) {
    // https://onsen.io/v2/guide/iphonex.html#iphone-x
    document.documentElement.setAttribute('onsflag-iphonex-portrait', '');
    document.documentElement.setAttribute('onsflag-iphonex-landscape', '');
}

import './vue-project';
github OnsenUI / OnsenUI / bindings / react / examples / components / LazyList.js View on Github external
            calculateItemHeight={() => ons.platform.isAndroid() ? 76 : 45}
          />
github OnsenUI / OnsenUI / bindings / angular2 / src / ons / platform.ts View on Github external
import * as ons from 'onsenui';

export const onsPlatform = ons.platform;
github OnsenUI / react-onsenui-kitchensink / components / InfiniteScroll.js View on Github external
          calculateItemHeight={() => ons.platform.isAndroid() ? 48 : 44}
        />
github OnsenUI / react-onsenui-kitchensink / components / Home.js View on Github external
import {
  Page,
  Toolbar,
  List,
  ListItem,
  ListHeader
} from 'react-onsenui';

import PullToRefresh from './PullToRefresh';
import InfiniteScroll from './InfiniteScroll';
import SideMenu from './SideMenu';
import FloatingActionButton from './FloatingActionButton';
import SpeedDials from './SpeedDials';

const initialPlatform = ons.platform.isAndroid() ? 'android' : 'ios';

class Home extends React.Component {
  gotoComponent(component, key) {
    this.props.navigator.pushPage({comp: component, props: { key }});
  }

  renderToolbar() {
    return (
      
        <div>Home</div>
      
    );
  }

  render() {
    return (