123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <template>
- <view class="u-swipe-action">
- <slot></slot>
- </view>
- </template>
- <script>
- import props from './props.js';
- import mpMixin from '../../libs/mixin/mpMixin.js';
- import mixin from '../../libs/mixin/mixin.js';
-
- export default {
- name: 'u-swipe-action',
- mixins: [mpMixin, mixin, props],
- data() {
- return {}
- },
- provide() {
- return {
- swipeAction: this
- }
- },
- computed: {
-
-
-
- parentData() {
- return [this.autoClose]
- }
- },
- watch: {
-
- parentData() {
- if (this.children.length) {
- this.children.map(child => {
-
- typeof(child.updateParentData) === 'function' && child.updateParentData()
- })
- }
- },
- },
- created() {
- this.children = []
- },
- methods: {
- closeOther(child) {
- if (this.autoClose) {
-
- this.children.map((item, index) => {
- if (child !== item) {
- item.closeHandler()
- }
- })
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- </style>
|