flx:修改一级路由嵌入报错bug
This commit is contained in:
parent
42d3dcbe14
commit
6488e09820
@ -10,6 +10,7 @@ VITE_API_URL = 'http://192.168.34.221:8111' #雄哥本地
|
|||||||
# VITE_API_URL = 'http://192.168.34.221:28890' #雄哥本地
|
# VITE_API_URL = 'http://192.168.34.221:28890' #雄哥本地
|
||||||
# VITE_API_URL = 'http://182.90.224.237:51234' #雄哥远程
|
# VITE_API_URL = 'http://182.90.224.237:51234' #雄哥远程
|
||||||
# VITE_API_URL = 'http://192.168.34.221:28889'
|
# VITE_API_URL = 'http://192.168.34.221:28889'
|
||||||
|
# VITE_API_URL = 'http://192.168.34.221:28887'
|
||||||
# VITE_API_URL = 'http://121.196.214.246/api'
|
# VITE_API_URL = 'http://121.196.214.246/api'
|
||||||
# VITE_API_URL = 'http://jxj.zhgdyun.com:100'
|
# VITE_API_URL = 'http://jxj.zhgdyun.com:100'
|
||||||
# VITE_API_URL = 'http://192.168.34.221:12360'
|
# VITE_API_URL = 'http://192.168.34.221:12360'
|
||||||
@ -54,7 +55,8 @@ VITE_API_URL = 'http://192.168.34.221:8111' #雄哥本地
|
|||||||
# VITE_API_URL = 'http://101.43.164.214:11126'
|
# VITE_API_URL = 'http://101.43.164.214:11126'
|
||||||
# 测试
|
# 测试
|
||||||
# VITE_API_URL = 'http://jxj.zhgdyun.com:9500'
|
# VITE_API_URL = 'http://jxj.zhgdyun.com:9500'
|
||||||
VITE_API_URL = 'http://192.168.34.221:19112'
|
# VITE_API_URL = 'http://192.168.34.221:19112'
|
||||||
|
# VITE_API_URL = 'https://125.72.229.30:19098'
|
||||||
# 上传
|
# 上传
|
||||||
VITE_ULD_API_URL = 'http://192.168.34.155:8012/onlinePreview?url='
|
VITE_ULD_API_URL = 'http://192.168.34.155:8012/onlinePreview?url='
|
||||||
|
|
||||||
|
|||||||
@ -1,18 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="iframe">
|
<div class="iframe">
|
||||||
<iframe :src="url" width="100%" height="100%" frameborder="0"></iframe>
|
<iframe :src="url" :key="ikey" width="100%" height="100%" frameborder="0"></iframe>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref, watch } from 'vue';
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const router = useRouter()
|
||||||
const url = ref("");
|
const url = ref("");
|
||||||
onMounted(() => {
|
const ikey = ref(0);
|
||||||
console.log(route.query); // 获取路由参数
|
watch(router.currentRoute, (newValue) => {
|
||||||
url.value = route.query.url; // 获取路由参数中的url值
|
// console.log(11334455, newValue.query.url, route.query.url); // 获取路由参数
|
||||||
});
|
url.value = newValue.query.url; // 获取路由参数中的url值
|
||||||
|
ikey.value = new Date().getTime(); // 刷新iframe
|
||||||
|
// console.log(url.value);
|
||||||
|
}, { immediate: true, deep: true });
|
||||||
|
// onMounted(() => {
|
||||||
|
// console.log(444555, route.query); // 获取路由参数
|
||||||
|
// // url.value = route.query.url; // 获取路由参数中的url值
|
||||||
|
// });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -557,7 +557,7 @@ let menuList = ref([]);
|
|||||||
// ]);
|
// ]);
|
||||||
const itemList = ref([]);
|
const itemList = ref([]);
|
||||||
const activeTab = ref(0);
|
const activeTab = ref(0);
|
||||||
const activeTab2 = ref(0);
|
const activeTab2 = ref('');
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const getAspectRatioStyle = computed(() => ({
|
const getAspectRatioStyle = computed(() => ({
|
||||||
width: `${contentWidth.value}px`,
|
width: `${contentWidth.value}px`,
|
||||||
@ -581,6 +581,23 @@ const navigateTo = (path, type) => {
|
|||||||
activeTab.value = path.modulePath;
|
activeTab.value = path.modulePath;
|
||||||
activeTab2.value = path.menuList.length ? path.menuList[0].companyPath : path.modulePath;
|
activeTab2.value = path.menuList.length ? path.menuList[0].companyPath : path.modulePath;
|
||||||
itemList.value = path.menuList;
|
itemList.value = path.menuList;
|
||||||
|
let index = activeTab2.value.indexOf("?");
|
||||||
|
console.log("获取到的参数----", index);
|
||||||
|
if (index > -1) {
|
||||||
|
let result = activeTab2.value.substring(index);
|
||||||
|
const uIndex = result.indexOf("url=");
|
||||||
|
if (uIndex > -1) {
|
||||||
|
const url = result.substring(uIndex + 4);
|
||||||
|
console.log("获取到的参数----", url);
|
||||||
|
router.push({
|
||||||
|
path: activeTab2.value,
|
||||||
|
query: {
|
||||||
|
url,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
router.push({
|
router.push({
|
||||||
path: activeTab2.value
|
path: activeTab2.value
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user