shaogen1995 11 月之前
父節點
當前提交
4d9ddf430b
共有 2 個文件被更改,包括 37 次插入4 次删除
  1. 27 2
      src/views/About.vue
  2. 10 2
      src/views/Home.vue

+ 27 - 2
src/views/About.vue

@@ -1,5 +1,30 @@
 <template>
-  <div class="about">
-    <h1>This is an about page</h1>
+  <div class="About">
+    <button @click="src='/index.html#/?m=kHmozE403325&time=1704175752215&id=1384'">点我</button>
+    <iframe v-if="src" :src="src" frameborder="0"></iframe>
   </div>
 </template>
+
+<script>
+export default {
+  components: {},
+  data() {
+    return {
+      src: "",
+    };
+  },
+  computed: {},
+  watch: {},
+  methods: {},
+  created() {},
+  mounted() {},
+  beforeCreate() {}, //生命周期 - 创建之前
+  beforeMount() {}, //生命周期 - 挂载之前
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang="less" scoped></style>

+ 10 - 2
src/views/Home.vue

@@ -307,7 +307,15 @@ export default {
           item.display = true;
         }
         // 如果有音频
-        if (item.id === "audio" && this.audio) item.display = true;
+        if (item.id === "audio" && this.audio) {
+          item.display = true;
+
+          // 初始播放音频
+          this.$nextTick(() => {
+            this.$refs.musicBg.play();
+            if (!this.$refs.musicBg.paused) this.audioAc(true);
+          });
+        }
       });
     },
 
@@ -632,4 +640,4 @@ export default {
     width: 100%;
   }
 }
-</style>
+</style>