123456789101112131415161718192021222324252627282930313233 |
- import baseComponent from '../helpers/baseComponent'
- import classNames from '../helpers/classNames'
- baseComponent({
- relations: {
- '../swipe-action/index': {
- type: 'descendant',
- observer() {
- this.debounce(this.updated)
- },
- },
- },
- methods: {
- updated() {
- const elements = this.getRelationNodes('../swipe-action/index')
- if (elements.length > 0) {
- elements.forEach((element, index) => {
- element.updated(index)
- })
- }
- },
- onCloseSwipe(current) {
- const elements = this.getRelationNodes('../swipe-action/index')
- if (elements.length > 0) {
- elements.forEach((element, index) => {
- if (current !== index) {
- element.onClose()
- }
- })
- }
- },
- },
- })
|