Skip to content

Commit 4aed3fe

Browse files
committed
update
1 parent fe44b1e commit 4aed3fe

1 file changed

Lines changed: 14 additions & 16 deletions

File tree

  • components/uni-swipe-action

‎components/uni-swipe-action/mp.js‎

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,43 @@
11
export default {
2-
data() {
2+
data () {
33
return {
44
position: [],
55
button: []
66
}
77
},
88
computed: {
9-
pos() {
9+
pos () {
1010
return JSON.stringify(this.position)
1111
},
12-
btn() {
12+
btn () {
1313
return JSON.stringify(this.button)
1414
}
1515
},
1616
watch: {
17-
show(newVal) {
17+
show (newVal) {
1818
if (this.autoClose) return
19-
let valueObj = this.position[0]
20-
if (!valueObj) {
21-
valueObj = []
22-
}
19+
let valueObj = this.position[0]
20+
if (!valueObj) return
2321
valueObj.show = newVal
2422
this.$set(this.position, 0, valueObj)
2523
}
2624
},
2725
// #ifdef H5
28-
mounted() {
26+
mounted () {
2927
this.init()
3028
this.getSize()
3129
this.getBUttonSize()
3230
},
3331
// #endif
3432
// #ifndef H5
35-
onReady() {
33+
onReady () {
3634
this.init()
3735
this.getSize()
3836
this.getBUttonSize()
3937
},
4038
// #endif
4139
methods: {
42-
init() {
40+
init () {
4341
uni.$on('__uni__swipe__event', (res) => {
4442
if (res !== this && this.autoClose) {
4543
let valueObj = this.position[0]
@@ -48,23 +46,23 @@ export default {
4846
}
4947
})
5048
},
51-
openSwipe() {
49+
openSwipe () {
5250
uni.$emit('__uni__swipe__event', this)
5351
},
54-
change(e) {
52+
change (e) {
5553
this.$emit('change', e.open)
5654
let valueObj = this.position[0]
5755
valueObj.show = e.open
5856
this.$set(this.position, 0, valueObj)
5957
// console.log('改变', e);
6058
},
61-
onClick(index, item) {
59+
onClick (index, item) {
6260
this.$emit('click', {
6361
content: item,
6462
index
6563
})
6664
},
67-
getSize() {
65+
getSize () {
6866
const views = uni.createSelectorQuery().in(this)
6967
views
7068
.selectAll('.selector-query-hock')
@@ -78,7 +76,7 @@ export default {
7876
})
7977
.exec()
8078
},
81-
getBUttonSize() {
79+
getBUttonSize () {
8280
const views = uni.createSelectorQuery().in(this)
8381
views
8482
.selectAll('.button-hock')

0 commit comments

Comments
 (0)