button.js
5 years ago
collapse.js
5 years ago
component-wrapper.js
5 years ago
list-table-heading.js
5 years ago
list-table-item.js
5 years ago
list-table.js
5 years ago
notice-component.js
5 years ago
notice.js
5 years ago
pagination.js
5 years ago
popup.js
5 years ago
repeater-item.js
5 years ago
repeater.js
5 years ago
tabs-panel.js
5 years ago
tabs.js
5 years ago
title.js
5 years ago
repeater-item.js
55 lines
| 1 | import { ElementMixin, HandleDirective } from 'vue-slicksort'; |
| 2 | |
| 3 | const RepeaterItem = { |
| 4 | name: 'cx-vui-repeater-item', |
| 5 | template: '#cx-vui-repeater-item', |
| 6 | mixins: [ ElementMixin ], |
| 7 | directives: { handle: HandleDirective }, |
| 8 | props: { |
| 9 | title: { |
| 10 | type: String, |
| 11 | }, |
| 12 | subtitle: { |
| 13 | type: String, |
| 14 | }, |
| 15 | collapsed: { |
| 16 | type: Boolean, |
| 17 | default: true, |
| 18 | }, |
| 19 | index: { |
| 20 | type: Number, |
| 21 | }, |
| 22 | customCss: { |
| 23 | type: String, |
| 24 | } |
| 25 | }, |
| 26 | data() { |
| 27 | return { |
| 28 | fieldData: this.field, |
| 29 | isCollapsed: this.collapsed, |
| 30 | showConfirmTip: false, |
| 31 | }; |
| 32 | }, |
| 33 | computed: { |
| 34 | customCssClass() { |
| 35 | return this.customCss; |
| 36 | }, |
| 37 | }, |
| 38 | methods: { |
| 39 | handleCopy() { |
| 40 | this.$emit( 'clone-item', this.index ); |
| 41 | }, |
| 42 | handleDelete() { |
| 43 | this.showConfirmTip = true; |
| 44 | }, |
| 45 | confrimDeletion() { |
| 46 | this.showConfirmTip = false; |
| 47 | this.$emit( 'delete-item', this.index ); |
| 48 | }, |
| 49 | cancelDeletion() { |
| 50 | this.showConfirmTip = false; |
| 51 | }, |
| 52 | }, |
| 53 | }; |
| 54 | |
| 55 | export default RepeaterItem; |