| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <template>
- <view>
- <view class="content">
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- bUnload: false
- }
- },
- onLoad(op) {
- /**
- * $on 之后要调用 $off,不然会重复绑定
- */
- uni.$on("game-load", () => {
- uni.$emit("setOnceGameOption", {});
- });
-
- uni.$on("game-unload", (data) => {
- if (!this.bUnload) {
- this.bUnload = true;
- uni.navigateBack({
- delta: 1
- })
- }
- });
-
- },
- onUnload() {
- //subview
- uni.$off("game-load");
- uni.$off("game-unload");
- },
- methods: {
-
- }
- }
- </script>
- <style>
- .content {
- align-content: center;
- height: 750rpx;
- background-color: #F4F5F6;
- }
- </style>
|