LoginSignup
2
2

More than 5 years have passed since last update.

OnsenUI 2 Beta.9から使えるons-iconのアイコン複数設定

Posted at

Beta.8以前では、実行する端末に合わせてons-ifを使って

<ons-if platform="android">
    <ons-icon icon="md-menu"></ons-icon>
</ons-if>
<ons-if platform="ios other">
    <ons-icon icon="ion-navicon" style="font-size: 32px; width: 1em;"></ons-icon>
</ons-if>

としていたのが、Beta.9から

<ons-icon icon="ion-navicon, material:md-menu" size="32px, material:24px">

と書けるようになった。

書く量が減るので嬉しい。

ツールバー内で使う場合はこれ推奨。
アイコンサイズをスタイルで設定しても無視されるっぽい。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2