mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	fix 修复 内链iframe没有传递参数问题
This commit is contained in:
		@@ -5,15 +5,23 @@
 | 
				
			|||||||
      :key="item.path"
 | 
					      :key="item.path"
 | 
				
			||||||
      :iframeId="'iframe' + index"
 | 
					      :iframeId="'iframe' + index"
 | 
				
			||||||
      v-show="route.path === item.path"
 | 
					      v-show="route.path === item.path"
 | 
				
			||||||
      :src="item.meta.link"
 | 
					      :src="iframeUrl(item.meta.link, item.query)"
 | 
				
			||||||
    ></inner-link>
 | 
					    ></inner-link>
 | 
				
			||||||
  </transition-group>
 | 
					  </transition-group>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script setup>
 | 
					<script setup>
 | 
				
			||||||
import InnerLink from "../InnerLink/index"
 | 
					import InnerLink from "../InnerLink/index";
 | 
				
			||||||
import useTagsViewStore from '@/store/modules/tagsView'
 | 
					import useTagsViewStore from "@/store/modules/tagsView";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const route = useRoute();
 | 
					const route = useRoute();
 | 
				
			||||||
const tagsViewStore = useTagsViewStore()
 | 
					const tagsViewStore = useTagsViewStore();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function iframeUrl(url, query) {
 | 
				
			||||||
 | 
					  if (Object.keys(query).length > 0) {
 | 
				
			||||||
 | 
					    let params = Object.keys(query).map((key) => key + "=" + query[key]).join("&");
 | 
				
			||||||
 | 
					    return url + "?" + params;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  return url;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,24 +1,33 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <transition-group name="fade-transform" mode="out-in">
 | 
					  <transition-group name="fade-transform" mode="out-in">
 | 
				
			||||||
    <inner-link
 | 
					    <inner-link
 | 
				
			||||||
      v-for="(item, index) in iframeViews"
 | 
					      v-for="(item, index) in iframeViews"
 | 
				
			||||||
      :key="item.path"
 | 
					      :key="item.path"
 | 
				
			||||||
      :iframeId="'iframe' + index"
 | 
					      :iframeId="'iframe' + index"
 | 
				
			||||||
      v-show="$route.path === item.path"
 | 
					      v-show="$route.path === item.path"
 | 
				
			||||||
      :src="item.meta.link"
 | 
					      :src="iframeUrl(item.meta.link, item.query)"
 | 
				
			||||||
    ></inner-link>
 | 
					    ></inner-link>
 | 
				
			||||||
  </transition-group>
 | 
					  </transition-group>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
import InnerLink from "../InnerLink/index"
 | 
					import InnerLink from "../InnerLink/index";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
  components: { InnerLink },
 | 
					  components: { InnerLink },
 | 
				
			||||||
  computed: {
 | 
					  computed: {
 | 
				
			||||||
    iframeViews() {
 | 
					    iframeViews() {
 | 
				
			||||||
      return this.$store.state.tagsView.iframeViews
 | 
					      return this.$store.state.tagsView.iframeViews;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  },
 | 
				
			||||||
}
 | 
					  methods: {
 | 
				
			||||||
</script>
 | 
					    iframeUrl(url, query) {
 | 
				
			||||||
 | 
					      if (Object.keys(query).length > 0) {
 | 
				
			||||||
 | 
					        let params = Object.keys(query).map((key) => key + "=" + query[key]).join("&");
 | 
				
			||||||
 | 
					        return url + "?" + params;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      return url;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user