提交 7ddb94bb 编写于 作者: M mehaotian

feat: 折叠面板

上级 68113477
...@@ -30,11 +30,10 @@ export default { ...@@ -30,11 +30,10 @@ export default {
setLifeCycleNum(state.lifeCycleNum - 100) setLifeCycleNum(state.lifeCycleNum - 100)
console.log('App Hide') console.log('App Hide')
}, },
onLastPageBackPress: function (): boolean | null { onLastPageBackPress: function () {
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum - 1000) setLifeCycleNum(state.lifeCycleNum - 1000)
console.log('App LastPageBackPress') console.log('App LastPageBackPress')
return null
}, },
methods: { methods: {
increasetLifeCycleNum() { increasetLifeCycleNum() {
......
...@@ -68,10 +68,12 @@ ...@@ -68,10 +68,12 @@
const boxNode = this.boxNode?.style!; const boxNode = this.boxNode?.style!;
const contentNode = this.contentNode?.style!; const contentNode = this.contentNode?.style!;
let hide = open ? 'flex' : 'none'; let hide = open ? 'flex' : 'none';
const opacity = open ? 1 : 0
let ani_transform = open ? 'translateY(0)' : 'translateY(-100%)'; let ani_transform = open ? 'translateY(0)' : 'translateY(-100%)';
boxNode.setProperty('display', hide); boxNode.setProperty('display', hide);
this.$nextTick(() => { this.$nextTick(() => {
contentNode.setProperty('transform', ani_transform); contentNode.setProperty('transform', ani_transform);
contentNode.setProperty('opacity', opacity);
}) })
} }
} }
...@@ -131,5 +133,6 @@ ...@@ -131,5 +133,6 @@
transition-property: transform; transition-property: transform;
transition-duration: 0.3s; transition-duration: 0.3s;
transform: translateY(-100%); transform: translateY(-100%);
opacity: 0;
} }
</style> </style>
\ No newline at end of file
...@@ -22,24 +22,6 @@ ...@@ -22,24 +22,6 @@
</template> </template>
</uni-collapse> </uni-collapse>
<!-- <view class="uni-panel" v-for="(item, index) in list" :key="item.id">
<view class="uni-panel-h" :class="item.open ? 'uni-panel-h-on' : ''" @click="triggerCollapse(index, item)">
<text class="uni-panel-text" :class="item.enable == false ? 'text-disabled' : ''">{{ item.name }}</text>
<image :src="
item.pages.length >
? item.open
? arrowUpIcon
: arrowDownIcon
: arrowRightIcon
" class="uni-icon"></image>
</view>
<view class="uni-panel-c" v-if="item.open">
<view class="uni-navigate-item" v-for="(page, key) in item.pages" :key="key" @click="goDetailPage(page)">
<text class="uni-navigate-text" :class="page.enable == false ? 'text-disabled' : ''">{{ page.name }}</text>
<image :src="arrowRightIcon" class="uni-icon"></image>
</view>
</view>
</view> -->
</view> </view>
<!-- #ifdef APP --> <!-- #ifdef APP -->
</scroll-view> </scroll-view>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</view> </view>
<view class="uni-hello-text"> <view class="uni-hello-text">
<text class="hello-text">uni-app x目前已支持的CSS属性,展示样式仅供参考,文档详见:</text> <text class="hello-text">uni-app x目前已支持的CSS属性,展示样式仅供参考,文档详见:</text>
<u-link :href="'https://uniapp.dcloud.io/uni-app-x/css/'" :text="'https://uniapp.dcloud.io/uni-app-x/css/'" :inWhiteList="true"></u-link> <u-link :href="'https://uniapp.dcloud.io/component/'" :text="'https://uniapp.dcloud.io/component/'" :inWhiteList="true"></u-link>
</view> </view>
<uni-collapse> <uni-collapse>
<template v-for="item in list" :key="item.id"> <template v-for="item in list" :key="item.id">
...@@ -20,24 +20,6 @@ ...@@ -20,24 +20,6 @@
</uni-collapse-item> </uni-collapse-item>
</template> </template>
</uni-collapse> </uni-collapse>
<!-- <view class="uni-panel" v-for="(item, index) in list" :key="item.id">
<view class="uni-panel-h" :class="item.open ? 'uni-panel-h-on' : ''" @click="triggerCollapse(index, item)">
<text class="uni-panel-text" :class="item.enable == false ? 'text-disabled' : ''">{{ item.name }}</text>
<image :src="
item.pages.length > 0
? item.open
? arrowUpIcon
: arrowDownIcon
: arrowRightIcon
" class="uni-icon"></image>
</view>
<view class="uni-panel-c" v-if="item.open">
<view class="uni-navigate-item" v-for="(page, key) in item.pages" :key="key" @click="goDetailPage(page)">
<text class="uni-navigate-text" :class="page.enable == false ? 'text-disabled' : ''">{{ page.name }}</text>
<image :src="arrowRightIcon" class="uni-icon"></image>
</view>
</view>
</view> -->
</view> </view>
<!-- #ifdef APP --> <!-- #ifdef APP -->
</scroll-view> </scroll-view>
...@@ -119,21 +101,6 @@ ...@@ -119,21 +101,6 @@
}, },
] as Page[], ] as Page[],
}, },
{
id: 'display',
name: 'display',
open: false,
pages: [
{
name: 'flex',
url: '/pages/CSS/display/flex',
},
{
name: 'none',
url: '/pages/CSS/display/none',
}
] as Page[],
},
{ {
id: 'flex', id: 'flex',
name: 'flex', name: 'flex',
...@@ -295,10 +262,6 @@ ...@@ -295,10 +262,6 @@
name: 'font-weight', name: 'font-weight',
url: '/pages/CSS/text/font-weight', url: '/pages/CSS/text/font-weight',
}, },
{
name: 'letter-spacing',
url: '/pages/CSS/text/letter-spacing',
},
{ {
name: 'line-height', name: 'line-height',
url: '/pages/CSS/text/line-height', url: '/pages/CSS/text/line-height',
...@@ -318,33 +281,18 @@ ...@@ -318,33 +281,18 @@
] as Page[], ] as Page[],
}, },
{ {
id: 'transform', id: 'animate',
name: 'transform', name: '动画',
open: false,
pages: [
{
name: 'translate',
url: '/pages/CSS/transform/translate',
},
{
name: 'scale',
url: '/pages/CSS/transform/scale',
},
{
name: 'rotate',
url: '/pages/CSS/transform/rotate',
},
] as Page[],
},
{
id: 'transition',
name: 'transition',
open: false, open: false,
pages: [ pages: [
{ {
name: 'transition', name: 'transition',
url: '/pages/CSS/transition/transition', url: '/pages/CSS/transition/transition',
}, },
{
name: 'transform',
url: '/pages/CSS/transform/transform',
},
] as Page[], ] as Page[],
}, },
] as ListItem[], ] as ListItem[],
......
...@@ -20,24 +20,6 @@ ...@@ -20,24 +20,6 @@
</uni-collapse-item> </uni-collapse-item>
</template> </template>
</uni-collapse> </uni-collapse>
<!-- <view class="uni-panel" v-for="(item, index) in list" :key="item.id">
<view class="uni-panel-h" :class="item.open ? 'uni-panel-h-on' : ''" @click="triggerCollapse(index, item)">
<text class="uni-panel-text" :class="item.enable == false ? 'text-disabled' : ''">{{ item.name }}</text>
<image :src="
item.pages.length > 0
? item.open
? arrowUpIcon
: arrowDownIcon
: arrowRightIcon
" class="uni-icon"></image>
</view>
<view class="uni-panel-c" v-if="item.open">
<view class="uni-navigate-item" v-for="(page, key) in item.pages" :key="key" @click="goDetailPage(page)">
<text class="uni-navigate-text" :class="page.enable == false ? 'text-disabled' : ''">{{ page.name }}</text>
<image :src="arrowRightIcon" class="uni-icon"></image>
</view>
</view>
</view> -->
</view> </view>
<!-- #ifdef APP --> <!-- #ifdef APP -->
</scroll-view> </scroll-view>
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<view class="uni-panel-c" v-if="item.open"> <view class="uni-panel-c" v-if="item.open">
<view <view
class="uni-navigate-item" class="uni-navigate-item"
:hover-class="page.enable == false?'':'is--active'"
v-for="(page, key) in item.pages" v-for="(page, key) in item.pages"
:key="key" :key="key"
@click="goDetailPage(page)" @click="goDetailPage(page)"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册