12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <template>
- <view class="u-swipe-action">
- <slot></slot>
- </view>
- </template>
- <script>
- import props from './props.js';
-
- export default {
- name: 'u-swipe-action',
- mixins: [uni.$u.mpMixin, uni.$u.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>
|