fix(drawer-ts-vue): highlight selected item in drawer (#129)

This commit is contained in:
Manol Donev 2019-10-30 18:44:50 +02:00 коммит произвёл GitHub
Родитель ec445e42ad
Коммит 4aace89b4a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 10 добавлений и 10 удалений

Просмотреть файл

@ -18,25 +18,25 @@ https://docs.nativescript.org/ui/professional-ui-components/SideDrawer/getting-s
<ScrollView row="1" class="nt-drawer__body">
<StackLayout>
<GridLayout columns="auto, *" class="{{ 'nt-drawer__list-item' + (selectedPage === 'Home' ? ' selected': '') }}"
<GridLayout columns="auto, *" class="{{ 'nt-drawer__list-item' + (selectedPage === 'Home' ? ' -selected': '') }}"
route="home/home-page" title="Home" tap="onNavigationItemTap">
<Label row="0" col="0" text="&#xf015;" class="nt-icon fas" />
<Label row="0" col="1" text="Home" class="p-r-10" />
</GridLayout>
<GridLayout columns="auto, *" class="{{ 'nt-drawer__list-item' + (selectedPage === 'Browse' ? ' selected': '') }}"
<GridLayout columns="auto, *" class="{{ 'nt-drawer__list-item' + (selectedPage === 'Browse' ? ' -selected': '') }}"
route="browse/browse-page" title="Browse" tap="onNavigationItemTap">
<Label row="0" col="0" text="&#xf1ea;" class="nt-icon far" />
<Label row="0" col="1" text="Browse" class="p-r-10" />
</GridLayout>
<GridLayout columns="auto, *" class="{{ 'nt-drawer__list-item' + (selectedPage === 'Search' ? ' selected': '') }}"
<GridLayout columns="auto, *" class="{{ 'nt-drawer__list-item' + (selectedPage === 'Search' ? ' -selected': '') }}"
route="search/search-page" title="Search" tap="onNavigationItemTap">
<Label row="0" col="0" text="&#xf002;" class="nt-icon fas" />
<Label row="0" col="1" text="Search" class="p-r-10" />
</GridLayout>
<GridLayout columns="auto, *" class="{{ 'nt-drawer__list-item' + (selectedPage === 'Featured' ? ' selected': '') }}"
<GridLayout columns="auto, *" class="{{ 'nt-drawer__list-item' + (selectedPage === 'Featured' ? ' -selected': '') }}"
route="featured/featured-page" title="Featured" tap="onNavigationItemTap">
<Label row="0" col="0" text="&#xf005;" class="nt-icon fas" />
<Label row="0" col="1" text="Featured" class="p-r-10" />
@ -44,7 +44,7 @@ https://docs.nativescript.org/ui/professional-ui-components/SideDrawer/getting-s
<StackLayout class="hr"></StackLayout>
<GridLayout columns="auto, *" class="{{ 'nt-drawer__list-item' + (selectedPage === 'Settings' ? ' selected': '') }}"
<GridLayout columns="auto, *" class="{{ 'nt-drawer__list-item' + (selectedPage === 'Settings' ? ' -selected': '') }}"
route="settings/settings-page" title="Settings" tap="onNavigationItemTap">
<Label row="0" col="0" text="&#xf013;" class="nt-icon fas" />
<Label row="0" col="1" text="Settings" class="p-r-10" />

Просмотреть файл

@ -8,29 +8,29 @@
<ScrollView row="1" class="nt-drawer__body">
<StackLayout>
<GridLayout columns="auto, *" :class="'nt-drawer__list-item' + (selectedPage === 'Home' ? ' selected': '')" @tap="onNavigationItemTap(Home)">
<GridLayout columns="auto, *" :class="'nt-drawer__list-item' + (selectedPage === 'Home' ? ' -selected': '')" @tap="onNavigationItemTap(Home)">
<Label col="0" text.decode="&#xf015;" class="nt-icon fas"></Label>
<Label col="1" text="Home" class="p-r-10"></Label>
</GridLayout>
<GridLayout columns="auto, *" :class="'nt-drawer__list-item' + (selectedPage === 'Browse' ? ' selected': '')" @tap="onNavigationItemTap(Browse)">
<GridLayout columns="auto, *" :class="'nt-drawer__list-item' + (selectedPage === 'Browse' ? ' -selected': '')" @tap="onNavigationItemTap(Browse)">
<Label col="0" text.decode="&#xf1ea;" class="nt-icon far"></Label>
<Label col="1" text="Browse" class="p-r-10"></Label>
</GridLayout>
<GridLayout columns="auto, *" :class="'nt-drawer__list-item' + (selectedPage === 'Search' ? ' selected': '')" @tap="onNavigationItemTap(Search)">
<GridLayout columns="auto, *" :class="'nt-drawer__list-item' + (selectedPage === 'Search' ? ' -selected': '')" @tap="onNavigationItemTap(Search)">
<Label col="0" text.decode="&#xf002;" class="nt-icon fas"></Label>
<Label col="1" text="Search" class="p-r-10"></Label>
</GridLayout>
<GridLayout columns="auto, *" :class="'nt-drawer__list-item' + (selectedPage === 'Featured' ? ' selected': '')" @tap="onNavigationItemTap(Featured)">
<GridLayout columns="auto, *" :class="'nt-drawer__list-item' + (selectedPage === 'Featured' ? ' -selected': '')" @tap="onNavigationItemTap(Featured)">
<Label col="0" text.decode="&#xf005;" class="nt-icon fas"></Label>
<Label col="1" text="Featured" class="p-r-10"></Label>
</GridLayout>
<StackLayout class="hr"></StackLayout>
<GridLayout columns="auto, *" :class="'nt-drawer__list-item' + (selectedPage === 'Settings' ? ' selected': '')" @tap="onNavigationItemTap(Settings)">
<GridLayout columns="auto, *" :class="'nt-drawer__list-item' + (selectedPage === 'Settings' ? ' -selected': '')" @tap="onNavigationItemTap(Settings)">
<Label col="0" text.decode="&#xf013;" class="nt-icon fas"></Label>
<Label col="1" text="Settings" class="p-r-10"></Label>
</GridLayout>