Skip to content

Commit e7b6ed0

Browse files
committed
fix: set collapse as accordion
1 parent 9e04d09 commit e7b6ed0

File tree

1 file changed

+11
-3
lines changed
  • front-end/h5/src/components/core/editor/edit-panel

1 file changed

+11
-3
lines changed

front-end/h5/src/components/core/editor/edit-panel/animation.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default {
1919
// TODO move this to vuex
2020
this.animationQueue.push({
2121
type: '',
22-
duration: 2,
22+
duration: 1,
2323
delay: 0,
2424
interationCount: 1,
2525
infinite: false
@@ -88,7 +88,7 @@ export default {
8888
defaultActiveKey={firstLevelAnimationOptions[0].label}
8989
onChange={tab => {}}
9090
style="width:100%;"
91-
tabBarStyle={{}}
91+
// tabBarStyle={{}}
9292
size="small"
9393
tabBarGutter={0}
9494
>
@@ -215,7 +215,15 @@ export default {
215215
// Q:这边为何这样写:this.animationQueue.length && ?
216216
// A:如果这样写的话,当 length === 0,的时候,0会显示在 UI 上
217217
!!this.animationQueue.length &&
218-
<a-collapse activeKey={'' + this.activeCollapsePanel} onChange={(val) => { this.activeCollapsePanel = val }} class="collapse-wrapper">
218+
<a-collapse
219+
accordion
220+
class="collapse-wrapper"
221+
activeKey={'' + this.activeCollapsePanel}
222+
onChange={(key) => {
223+
// 当全部收起来时候,key 为 undefined
224+
this.activeCollapsePanel = typeof key !== 'undefined' ? +key : -1
225+
}}
226+
>
219227
{
220228
this.animationQueue.map((addedAnimation, index) => (
221229
<a-collapse-panel key={`${index}`}>

0 commit comments

Comments
 (0)