Showing
3 changed files
with
35 additions
and
20 deletions
| ... | @@ -256,11 +256,4 @@ export default [{ | ... | @@ -256,11 +256,4 @@ export default [{ |
| 256 | title: '我的视频' | 256 | title: '我的视频' |
| 257 | }, | 257 | }, |
| 258 | children: [] | 258 | children: [] |
| 259 | -}, { | ||
| 260 | - path: '/image', | ||
| 261 | - name: 'html转图片', | ||
| 262 | - component: () => import('./views/html2canvas.vue'), | ||
| 263 | - meta: { | ||
| 264 | - title: '' | ||
| 265 | - } | ||
| 266 | }]; | 259 | }]; | ... | ... |
| ... | @@ -87,10 +87,13 @@ import icon_book from '@images/shu@2x.png' | ... | @@ -87,10 +87,13 @@ import icon_book from '@images/shu@2x.png' |
| 87 | import BookCard from '@/components/BookCard/index.vue' | 87 | import BookCard from '@/components/BookCard/index.vue' |
| 88 | import ShortcutFixed from '@/components/ShortcutFixed/index.vue' | 88 | import ShortcutFixed from '@/components/ShortcutFixed/index.vue' |
| 89 | 89 | ||
| 90 | -import { ref, reactive } from 'vue' | 90 | +import { ref, reactive, onMounted } from 'vue' |
| 91 | import { useRoute, useRouter } from 'vue-router' | 91 | import { useRoute, useRouter } from 'vue-router' |
| 92 | import axios from '@/utils/axios'; | 92 | import axios from '@/utils/axios'; |
| 93 | import { Toast } from 'vant'; | 93 | import { Toast } from 'vant'; |
| 94 | + | ||
| 95 | +import IMAGE from '@/views/html2canvas.vue' | ||
| 96 | + | ||
| 94 | const $route = useRoute(); | 97 | const $route = useRoute(); |
| 95 | const $router = useRouter(); | 98 | const $router = useRouter(); |
| 96 | 99 | ||
| ... | @@ -127,6 +130,28 @@ axios.get('/srv/?a=kg_info') | ... | @@ -127,6 +130,28 @@ axios.get('/srv/?a=kg_info') |
| 127 | }) | 130 | }) |
| 128 | .catch(err => { | 131 | .catch(err => { |
| 129 | console.error(err); | 132 | console.error(err); |
| 133 | +}); | ||
| 134 | + | ||
| 135 | +// 测试动态路由 | ||
| 136 | +/** | ||
| 137 | + * , { | ||
| 138 | + path: '/image', | ||
| 139 | + name: 'html转图片', | ||
| 140 | + component: () => import('./views/html2canvas.vue'), | ||
| 141 | + meta: { | ||
| 142 | + title: '' | ||
| 143 | + } | ||
| 144 | + } | ||
| 145 | + */ | ||
| 146 | + | ||
| 147 | +// $router.addRoute({ path: '/image', name: 'html转图片', meta: { title: 'html转图片' }, component: IMAGE}) | ||
| 148 | + | ||
| 149 | +onMounted(() => { | ||
| 150 | + // setTimeout(() => { | ||
| 151 | + // $router.push({ | ||
| 152 | + // path: '/image' | ||
| 153 | + // }) | ||
| 154 | + // }, 3000); | ||
| 130 | }) | 155 | }) |
| 131 | </script> | 156 | </script> |
| 132 | 157 | ... | ... |
| ... | @@ -38,6 +38,13 @@ import axios from '@/utils/axios'; | ... | @@ -38,6 +38,13 @@ import axios from '@/utils/axios'; |
| 38 | 38 | ||
| 39 | import { wxInfo } from '@/utils/tools'; | 39 | import { wxInfo } from '@/utils/tools'; |
| 40 | 40 | ||
| 41 | +const $route = useRoute(); | ||
| 42 | +const $router = useRouter(); | ||
| 43 | + | ||
| 44 | +// TAG: keepAlive 缓存页面 | ||
| 45 | +const store = mainStore(); | ||
| 46 | +store.keepThisPage($route.meta.name); | ||
| 47 | + | ||
| 41 | // 滚动条判断 | 48 | // 滚动条判断 |
| 42 | function hasScrollbar() { | 49 | function hasScrollbar() { |
| 43 | return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight); | 50 | return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight); |
| ... | @@ -51,15 +58,10 @@ onMounted(() => { | ... | @@ -51,15 +58,10 @@ onMounted(() => { |
| 51 | location.reload() | 58 | location.reload() |
| 52 | } | 59 | } |
| 53 | } | 60 | } |
| 61 | + // 背景颜色全屏 | ||
| 62 | + $('.client-index-page').height($(document).height()); | ||
| 54 | }) | 63 | }) |
| 55 | 64 | ||
| 56 | -const $route = useRoute(); | ||
| 57 | -const $router = useRouter(); | ||
| 58 | - | ||
| 59 | -// TAG: keepAlive 缓存页面 | ||
| 60 | -const store = mainStore(); | ||
| 61 | -store.keepThisPage($route.meta.name); | ||
| 62 | - | ||
| 63 | // 自定义按钮颜色样式 | 65 | // 自定义按钮颜色样式 |
| 64 | const styleObject1 = reactive({ | 66 | const styleObject1 = reactive({ |
| 65 | backgroundColor: '#FFFFFF', | 67 | backgroundColor: '#FFFFFF', |
| ... | @@ -85,11 +87,6 @@ const goSchool = () => { // 跳转选择幼儿园页面 | ... | @@ -85,11 +87,6 @@ const goSchool = () => { // 跳转选择幼儿园页面 |
| 85 | Cookies.set('userType', 'client'); // 客户标识 | 87 | Cookies.set('userType', 'client'); // 客户标识 |
| 86 | } | 88 | } |
| 87 | 89 | ||
| 88 | -onMounted(() => { | ||
| 89 | - // 背景颜色全屏 | ||
| 90 | - $('.client-index-page').height($(document).height()); | ||
| 91 | -}) | ||
| 92 | - | ||
| 93 | // TEMP:临时测试动画效果 | 90 | // TEMP:临时测试动画效果 |
| 94 | // const show = ref(true); | 91 | // const show = ref(true); |
| 95 | // const interval = setInterval(() => { // 图标动画效果 | 92 | // const interval = setInterval(() => { // 图标动画效果 | ... | ... |
-
Please register or login to post a comment