We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
通过new Image和appendChild添加图片,当图片地址会动态修改时会出现dom上频繁添加删除的现象。但是当子应用独立运行的时候就没有这个问题
new Image
appendChild
<template> <div ref="imgRef"></div> </template> <script setup lang="ts"> import { onMounted, ref, shallowRef, watch } from 'vue' const imgRef = ref() const props = defineProps({ src: { type: String, required: true, }, }) onMounted(() => { loadImage() }) watch(() => props.src, () => { loadImage() }) const _img = shallowRef() function loadImage() { const img = new Image() img.onload = () => { if (_img.value) { _img.value.remove() } _img.value = img imgRef.value.appendChild(img) } img.src = props.src } </script>
克隆复现仓库
pnpm i cd packages/base pnpm dev cd packages/micro pnpm dev
访问http://localhost:8987
观察到最下方的图标会频繁在vue.svg和vite.svg中切换
vue.svg
vite.svg
直接访问子应用http://localhost:8988
观察到最下方的图标初始为vite.svg,0.3s后切换为vue.svg
microapp-demo
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题描述
复现步骤
克隆复现仓库
访问http://localhost:8987
观察到最下方的图标会频繁在
vue.svg
和vite.svg
中切换直接访问子应用http://localhost:8988
观察到最下方的图标初始为
vite.svg
,0.3s后切换为vue.svg
上传截图
复现仓库
环境信息
The text was updated successfully, but these errors were encountered: