Commit e7b6ed065200f044062ebcaab094db2587b975b0

Authored by ly525
1 parent 9e04d09b

fix: set collapse as accordion

front-end/h5/src/components/core/editor/edit-panel/animation.js
@@ -19,7 +19,7 @@ export default { @@ -19,7 +19,7 @@ export default {
19 // TODO move this to vuex 19 // TODO move this to vuex
20 this.animationQueue.push({ 20 this.animationQueue.push({
21 type: '', 21 type: '',
22 - duration: 2, 22 + duration: 1,
23 delay: 0, 23 delay: 0,
24 interationCount: 1, 24 interationCount: 1,
25 infinite: false 25 infinite: false
@@ -88,7 +88,7 @@ export default { @@ -88,7 +88,7 @@ export default {
88 defaultActiveKey={firstLevelAnimationOptions[0].label} 88 defaultActiveKey={firstLevelAnimationOptions[0].label}
89 onChange={tab => {}} 89 onChange={tab => {}}
90 style="width:100%;" 90 style="width:100%;"
91 - tabBarStyle={{}} 91 + // tabBarStyle={{}}
92 size="small" 92 size="small"
93 tabBarGutter={0} 93 tabBarGutter={0}
94 > 94 >
@@ -215,7 +215,15 @@ export default { @@ -215,7 +215,15 @@ export default {
215 // Q:这边为何这样写:this.animationQueue.length && ? 215 // Q:这边为何这样写:this.animationQueue.length && ?
216 // A:如果这样写的话,当 length === 0,的时候,0会显示在 UI 上 216 // A:如果这样写的话,当 length === 0,的时候,0会显示在 UI 上
217 !!this.animationQueue.length && 217 !!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 + >
219 { 227 {
220 this.animationQueue.map((addedAnimation, index) => ( 228 this.animationQueue.map((addedAnimation, index) => (
221 <a-collapse-panel key={`${index}`}> 229 <a-collapse-panel key={`${index}`}>