Browse Source

[edit][ui]

zhangwei 3 years ago
parent
commit
e69f3fe5a8
5 changed files with 32 additions and 14 deletions
  1. 7 1
      src/iframe/home.js
  2. 0 1
      src/router/popup.js
  3. 2 2
      src/view/home.vue
  4. 1 1
      src/view/popup/components/head.vue
  5. 22 9
      src/view/popup/index.vue

+ 7 - 1
src/iframe/home.js

@@ -1,4 +1,10 @@
 import { createApp } from 'vue'
 import App from '@/view/home.vue'
 
-createApp(App).mount('#app')
+const app = createApp(App)
+
+// 引入路由对象实例
+import router from '@/router/popup.js'
+app.use(router)
+console.log(router)
+app.mount('#app')

+ 0 - 1
src/router/popup.js

@@ -1,6 +1,5 @@
 /* eslint-disable */
 import { createRouter, createWebHashHistory, createWebHistory } from "vue-router"
-
 import Home from '@/view/popup/popup.vue'
 import Withdraw from '@/view/popup/withdraw/index.vue'
 import WithdrawInfo from '@/view/popup/withdraw/info.vue'

+ 2 - 2
src/view/home.vue

@@ -9,8 +9,7 @@
 
 <script setup>
 import { onMounted, ref } from "vue";
-
-import popup from './popup/popup.vue'
+import popup from './popup/index.vue'
 
 let contentStyle = ref({});
 
@@ -39,6 +38,7 @@ onMounted(() => {
         box-sizing: border-box;
         box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.2);
         border-radius: 15px;
+        position: relative;
     }
 }
 /deep/ .page-wrapper {

+ 1 - 1
src/view/popup/components/head.vue

@@ -111,7 +111,7 @@ function clickItem(path) {
         .option {
             position: absolute;
             top: 43px;
-            left: 120px;
+            right: 15px;
             background: #fff;
             filter: drop-shadow(0px 3px 20px rgba(0, 0, 0, 0.2));
             width: 240px;

+ 22 - 9
src/view/popup/index.vue

@@ -1,19 +1,32 @@
 <template>
+  <div class="home_content" :class="{ popup_content: state.popup }">
     <router-view></router-view>
+  </div>
 </template>
 
-<script>
-export default {
-  name: 'popup-home',
-}
+<script setup>
+import { reactive, onMounted } from 'vue'
+let state = reactive({
+  popup: true
+})
+onMounted(() => {
+  if (window.location.href.indexOf('home.html') > 0) {
+    state.popup = false
+  }
+})
+
 </script>
 
 
 <style>
-#app{
-    width: 375px;
-    height: 600px;
-    box-sizing: border-box;
-    overflow-y: auto;
+.home_content{
+  width: 100%;
+  height: 100%;
+}
+.popup_content {
+  width: 375px;
+  height: 600px;
+  box-sizing: border-box;
+  overflow-y: auto;
 }
 </style>