|
|
@@ -14,7 +14,9 @@ import {
|
|
|
reactive,
|
|
|
toRefs,
|
|
|
watch,
|
|
|
- nextTick
|
|
|
+ nextTick,
|
|
|
+ onUnmounted,
|
|
|
+ onDeactivated
|
|
|
} from 'vue';
|
|
|
import Taro from '@tarojs/taro';
|
|
|
import { createComponent } from '../../utils/create';
|
|
|
@@ -68,6 +70,16 @@ export default create({
|
|
|
run();
|
|
|
});
|
|
|
|
|
|
+ onUnmounted(() => {
|
|
|
+ clearInterval(timer);
|
|
|
+ timer = 0;
|
|
|
+ });
|
|
|
+
|
|
|
+ onDeactivated(() => {
|
|
|
+ clearInterval(timer);
|
|
|
+ timer = 0;
|
|
|
+ });
|
|
|
+
|
|
|
watch(
|
|
|
() => props.danmu,
|
|
|
(newValue, oldVlaue) => {
|