提交 8e917c1b 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

style(tabBar): 优化折叠面板缩进样式

上级 eeb6c047
...@@ -14,16 +14,20 @@ ...@@ -14,16 +14,20 @@
<uni-collapse> <uni-collapse>
<uni-collapse-item ref="category" v-for="menuItem in menu" :key="menuItem!.id" :title="menuItem.name" <uni-collapse-item ref="category" v-for="menuItem in menu" :key="menuItem!.id" :title="menuItem.name"
class="item"> class="item">
<view v-for="page in menuItem.pages" :key="page!.path" class="uni-navigate-item" hover-class="is--active" <view style='padding-left:18px;' v-for="page in menuItem.pages" :key="page!.path" class="uni-navigate-item"
@click="goPage(`/${page.path}`)"> hover-class="is--active" @click="goPage(`/${page.path}`)">
<text class="uni-navigate-text" :class="{'left-win-active': leftWinActive === page.path && hasLeftWin}">{{page.style["navigationBarTitleText"]}}</text> <text class="uni-navigate-text" :class="{'left-win-active': leftWinActive === page.path && hasLeftWin}">{{
page.style["navigationBarTitleText"]
}}</text>
<image :src="arrowRightIcon" class="uni-icon-size"></image> <image :src="arrowRightIcon" class="uni-icon-size"></image>
</view> </view>
<uni-collapse style="width: 100%" v-for="childMenu in menuItem.children" :key="childMenu!.id"> <uni-collapse style="width: 100%" v-for="childMenu in menuItem.children" :key="childMenu!.id">
<uni-collapse-item :title="childMenu.name" class="item" style="margin-bottom: 0"> <uni-collapse-item :title="childMenu.name" class="item"
<view class="uni-navigate-item" hover-class="is--active" v-for="childPage in childMenu.pages" style="margin-bottom: 0;padding-left: 5px;padding-right: 5px;">
:key="childPage!.path" @click="goPage(`/${childPage.path}`)"> <view style='padding-left: 18px;' class="uni-navigate-item" hover-class="is--active"
<text class="uni-navigate-text">{{ v-for="childPage in childMenu.pages" :key="childPage!.path" @click="goPage(`/${childPage.path}`)">
<text class="uni-navigate-text"
:class="{'left-win-active': leftWinActive === childPage.path && hasLeftWin}">{{
childPage.style["navigationBarTitleText"] childPage.style["navigationBarTitleText"]
}}</text> }}</text>
<image :src="arrowRightIcon" class="uni-icon-size"></image> <image :src="arrowRightIcon" class="uni-icon-size"></image>
...@@ -56,10 +60,10 @@ ...@@ -56,10 +60,10 @@
} }
}, },
computed: { computed: {
hasLeftWin():boolean{ hasLeftWin() : boolean {
return !state.noMatchLeftWindow return !state.noMatchLeftWindow
}, },
leftWinActive():string{ leftWinActive() : string {
return state.leftWinActive.slice(1) return state.leftWinActive.slice(1)
} }
}, },
...@@ -82,7 +86,7 @@ ...@@ -82,7 +86,7 @@
} }
}, },
// #ifdef WEB // #ifdef WEB
watch:{ watch: {
$route: { $route: {
immediate: true, immediate: true,
handler(newRoute) { handler(newRoute) {
......
...@@ -14,18 +14,20 @@ ...@@ -14,18 +14,20 @@
<uni-collapse> <uni-collapse>
<uni-collapse-item ref="category" v-for="menuItem in menu" :key="menuItem!.id" :title="menuItem.name" <uni-collapse-item ref="category" v-for="menuItem in menu" :key="menuItem!.id" :title="menuItem.name"
class="item"> class="item">
<view v-for="page in menuItem.pages" :key="page!.path" class="uni-navigate-item" hover-class="is--active" <view style='padding-left:18px;' v-for="page in menuItem.pages" :key="page!.path" class="uni-navigate-item"
@click="goPage(`/${page.path}`)"> hover-class="is--active" @click="goPage(`/${page.path}`)">
<text class="uni-navigate-text" :class="{'left-win-active': leftWinActive === page.path && hasLeftWin}">{{ <text class="uni-navigate-text" :class="{'left-win-active': leftWinActive === page.path && hasLeftWin}">{{
page.style["navigationBarTitleText"] page.style["navigationBarTitleText"]
}}</text> }}</text>
<image :src="arrowRightIcon" class="uni-icon-size"></image> <image :src="arrowRightIcon" class="uni-icon-size"></image>
</view> </view>
<uni-collapse style="width: 100%" v-for="childMenu in menuItem.children" :key="childMenu!.id"> <uni-collapse style="width: 100%" v-for="childMenu in menuItem.children" :key="childMenu!.id">
<uni-collapse-item :title="childMenu.name" class="item" style="margin-bottom: 0"> <uni-collapse-item :title="childMenu.name" class="item"
<view class="uni-navigate-item" hover-class="is--active" v-for="childPage in childMenu.pages" style="margin-bottom: 0;padding-left: 5px;padding-right: 5px;">
:key="childPage!.path" @click="goPage(`/${childPage.path}`)"> <view style='padding-left: 18px;' class="uni-navigate-item" hover-class="is--active"
<text class="uni-navigate-text">{{ v-for="childPage in childMenu.pages" :key="childPage!.path" @click="goPage(`/${childPage.path}`)">
<text class="uni-navigate-text"
:class="{'left-win-active': leftWinActive === childPage.path && hasLeftWin}">{{
childPage.style["navigationBarTitleText"] childPage.style["navigationBarTitleText"]
}}</text> }}</text>
<image :src="arrowRightIcon" class="uni-icon-size"></image> <image :src="arrowRightIcon" class="uni-icon-size"></image>
...@@ -53,10 +55,10 @@ ...@@ -53,10 +55,10 @@
} }
}, },
computed: { computed: {
hasLeftWin():boolean{ hasLeftWin() : boolean {
return !state.noMatchLeftWindow return !state.noMatchLeftWindow
}, },
leftWinActive():string{ leftWinActive() : string {
return state.leftWinActive.slice(1) return state.leftWinActive.slice(1)
} }
}, },
...@@ -66,7 +68,7 @@ ...@@ -66,7 +68,7 @@
}, },
}, },
// #ifdef WEB // #ifdef WEB
watch:{ watch: {
$route: { $route: {
immediate: true, immediate: true,
handler(newRoute) { handler(newRoute) {
......
...@@ -14,18 +14,20 @@ ...@@ -14,18 +14,20 @@
<uni-collapse> <uni-collapse>
<uni-collapse-item ref="category" v-for="menuItem in menu" :key="menuItem!.id" :title="menuItem.name" <uni-collapse-item ref="category" v-for="menuItem in menu" :key="menuItem!.id" :title="menuItem.name"
class="item"> class="item">
<view v-for="page in menuItem.pages" :key="page!.path" class="uni-navigate-item" hover-class="is--active" <view style='padding-left:18px;' v-for="page in menuItem.pages" :key="page!.path" class="uni-navigate-item"
@click="goPage(`/${page.path}`)"> hover-class="is--active" @click="goPage(`/${page.path}`)">
<text class="uni-navigate-text" :class="{'left-win-active': leftWinActive === page.path && hasLeftWin}">{{ <text class="uni-navigate-text" :class="{'left-win-active': leftWinActive === page.path && hasLeftWin}">{{
page.style["navigationBarTitleText"] page.style["navigationBarTitleText"]
}}</text> }}</text>
<image :src="arrowRightIcon" class="uni-icon-size"></image> <image :src="arrowRightIcon" class="uni-icon-size"></image>
</view> </view>
<uni-collapse style="width: 100%" v-for="childMenu in menuItem.children" :key="childMenu!.id"> <uni-collapse style="width: 100%" v-for="childMenu in menuItem.children" :key="childMenu!.id">
<uni-collapse-item :title="childMenu.name" class="item" style="margin-bottom: 0"> <uni-collapse-item :title="childMenu.name" class="item"
<view class="uni-navigate-item" hover-class="is--active" v-for="childPage in childMenu.pages" style="margin-bottom: 0;padding-left: 5px;padding-right: 5px;">
:key="childPage!.path" @click="goPage(`/${childPage.path}`)"> <view style='padding-left: 18px;' class="uni-navigate-item" hover-class="is--active"
<text class="uni-navigate-text" :class="{'left-win-active': leftWinActive === childPage.path && hasLeftWin}">{{ v-for="childPage in childMenu.pages" :key="childPage!.path" @click="goPage(`/${childPage.path}`)">
<text class="uni-navigate-text"
:class="{'left-win-active': leftWinActive === childPage.path && hasLeftWin}">{{
childPage.style["navigationBarTitleText"] childPage.style["navigationBarTitleText"]
}}</text> }}</text>
<image :src="arrowRightIcon" class="uni-icon-size"></image> <image :src="arrowRightIcon" class="uni-icon-size"></image>
...@@ -61,10 +63,10 @@ ...@@ -61,10 +63,10 @@
} }
}, },
computed: { computed: {
hasLeftWin():boolean{ hasLeftWin() : boolean {
return !state.noMatchLeftWindow return !state.noMatchLeftWindow
}, },
leftWinActive():string{ leftWinActive() : string {
return state.leftWinActive.slice(1) return state.leftWinActive.slice(1)
} }
}, },
...@@ -86,7 +88,7 @@ ...@@ -86,7 +88,7 @@
// #endif // #endif
}, },
// #ifdef WEB // #ifdef WEB
watch:{ watch: {
$route: { $route: {
immediate: true, immediate: true,
handler(newRoute) { handler(newRoute) {
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</image> </image>
</view> </view>
<view v-if="item.open"> <view v-if="item.open">
<view class="uni-navigate-item" :hover-class="page.enable == false ? '' : 'is--active'" <view style="padding-left: 18px;" class="uni-navigate-item" :hover-class="page.enable == false ? '' : 'is--active'"
v-for="(page, key) in item.pages" :key="key" @click="goDetailPage(page)"> v-for="(page, key) in item.pages" :key="key" @click="goDetailPage(page)">
<text class="uni-navigate-text" :class="{'left-win-active': leftWinActive === page.url && hasLeftWin,'text-disabled' : page.enable == false}">{{ page.name }}</text> <text class="uni-navigate-text" :class="{'left-win-active': leftWinActive === page.url && hasLeftWin,'text-disabled' : page.enable == false}">{{ page.name }}</text>
<image :src="arrowRightIcon" class="uni-icon-size"></image> <image :src="arrowRightIcon" class="uni-icon-size"></image>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册