1 parent 3224293 commit fac1d3bCopy full SHA for fac1d3b
1 file changed
platforms/app-plus/shake/shake.vue
@@ -8,7 +8,8 @@
8
</view>
9
10
</template>
11
-<script>
+<script>
12
+ let music = uni.createInnerAudioContext();
13
export default {
14
data() {
15
return {
@@ -18,7 +19,6 @@
18
19
}
20
},
21
onLoad: function () {
- let music = uni.createInnerAudioContext();
22
music.src = 'https://img-cdn-qiniu.dcloud.net.cn/uniapp/shake/shake.wav';
23
24
let index = 1,
@@ -50,7 +50,8 @@
50
onUnload() {
51
this.show = false;
52
this.isOpened = false;
53
- uni.stopAccelerometer();
+ uni.stopAccelerometer();
54
+ music.destroy();
55
56
57
</script>
0 commit comments