fix 格式化

pull/9/head
wangxueliang 2018-02-01 18:32:17 +08:00
parent fdc40264b4
commit aa519f6014
8 changed files with 54 additions and 65 deletions

View File

@ -3,24 +3,13 @@ import PropTypes from '../_util/vue-types'
import animation from '../_util/openAnimation' import animation from '../_util/openAnimation'
import { getOptionProps } from '../_util/props-util' import { getOptionProps } from '../_util/props-util'
import RcCollapse from './src' import RcCollapse from './src'
import { collapseProps } from './src/commonProps'
export default { export default {
props: { props: {
prefixCls: PropTypes.string.def('ant-collapse'), ...collapseProps,
bordered: PropTypes.bool.def(true), bordered: PropTypes.bool.def(true),
openAnimation: PropTypes.any.def({ ...animation, appear () { } }), openAnimation: PropTypes.any.def({ ...animation, appear () { } }),
activeKey: PropTypes.oneOfType([
PropTypes.string,
PropTypes.arrayOf(PropTypes.string),
]),
defaultValue: PropTypes.oneOfType([
PropTypes.string,
PropTypes.arrayOf(PropTypes.string),
]),
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.arrayOf(PropTypes.string),
]),
change: PropTypes.func.def(() => {}), change: PropTypes.func.def(() => {}),
accordion: PropTypes.bool, accordion: PropTypes.bool,
}, },

View File

@ -26,11 +26,11 @@ Accordion mode, only one panel can be expanded at a time. The first panel will b
</template> </template>
<script> <script>
export default { export default {
data () { data () {
return { return {
text: `A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.`, text: `A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.`,
} }
}, },
} }
</script> </script>
``` ```

View File

@ -26,17 +26,17 @@ More than one panel can be expanded at a time, the first panel is initialized to
</template> </template>
<script> <script>
export default { export default {
data () { data () {
return { return {
text: `A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.`, text: `A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.`,
value: ['1'] value: ['1']
} }
},
methods: {
changeActivekey (key) {
console.log(key)
}, },
}, methods: {
} changeActivekey (key) {
console.log(key)
},
},
}
</script> </script>
``` ```

View File

@ -26,11 +26,11 @@ A borderless style of Collapse.
</template> </template>
<script> <script>
export default { export default {
data () { data () {
return { return {
text: `A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.`, text: `A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.`,
} }
}, },
} }
</script> </script>
``` ```

View File

@ -26,12 +26,12 @@ Customize the background, border and margin styles for each panel.
</template> </template>
<script> <script>
export default { export default {
data () { data () {
return { return {
text: `A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.`, text: `A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.`,
customStyle: 'background: #f7f7f7;border-radius: 4px;margin-bottom: 24px;border: 0;overflow: hidden' customStyle: 'background: #f7f7f7;border-radius: 4px;margin-bottom: 24px;border: 0;overflow: hidden'
} }
}, },
} }
</script> </script>
``` ```

View File

@ -30,16 +30,16 @@
</template> </template>
<script> <script>
export default { export default {
data () { data () {
return { return {
text: `A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.`, text: `A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.`,
} }
},
methods: {
changeActivekey (key) {
console.log(key)
}, },
}, methods: {
} changeActivekey (key) {
console.log(key)
},
},
}
</script> </script>
``` ```

View File

@ -23,16 +23,16 @@ You can disable showing arrow icon by passing `:showArrow="false"` to `a-collaps
</template> </template>
<script> <script>
export default { export default {
data () { data () {
return { return {
text: `A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.`, text: `A dog is a type of domesticated animal.Known for its loyalty and faithfulness,it can be found as a welcome guest in many households across the world.`,
} }
},
methods: {
changeActivekey (key) {
console.log(key)
}, },
}, methods: {
} changeActivekey (key) {
console.log(key)
},
},
}
</script> </script>
``` ```

View File

@ -1,7 +1,7 @@
import PropTypes from '../../_util/vue-types' import PropTypes from '../../_util/vue-types'
const collapseProps = { const collapseProps = {
prefixCls: PropTypes.string, prefixCls: PropTypes.string.def('ant-collapse'),
value: PropTypes.oneOfType([ value: PropTypes.oneOfType([
PropTypes.string, PropTypes.string,
PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.string),
@ -16,7 +16,7 @@ const collapseProps = {
const panelProps = { const panelProps = {
openAnimation: PropTypes.object, openAnimation: PropTypes.object,
prefixCls: PropTypes.string, prefixCls: PropTypes.string.def('ant-collapse'),
header: PropTypes.oneOfType([ header: PropTypes.oneOfType([
PropTypes.string, PropTypes.string,
PropTypes.number, PropTypes.number,