Skip to content
New issue

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

重新设置html后图片一直会显示loading状态 #55

Open
Vinsurs opened this issue Feb 27, 2022 · 2 comments
Open

重新设置html后图片一直会显示loading状态 #55

Vinsurs opened this issue Feb 27, 2022 · 2 comments

Comments

@Vinsurs
Copy link

Vinsurs commented Feb 27, 2022

大佬, 代码如下:

const Page: FC = () => {
    const html = `
        <h2 style="color: red;">文章标题</h2>
        <main>
            <article>文章内容</article>
            <img src="https://storage.360buyimg.com/cjj-pub-images/taro-daily.jpeg" alt="图片" width="100%" height="auto" />
            <p>这是很长一段文字</p>
        </main>
    `
    const [htmlText, setHtmlText] = useState(html)
    const handleClick = () => {
        setHtmlText(html + `<footer>这里是页脚</footer>`)
    }
return (
        <View>
            <View>我的</View>
            <View>
                <wxParse nodes={htmlText} />
            </View>
            <Button type='primary' onClick={handleClick}>改变html</Button>
        </View>
    )
}
export default Page

当我点击按钮改变html的时候,图片一直会显示loading状态而不显示出图片来,麻烦看下这个bug呢?开源不易 ,万分感谢!

@csonchen
Copy link
Owner

csonchen commented Mar 3, 2022

大佬, 代码如下:

const Page: FC = () => {
    const html = `
        <h2 style="color: red;">文章标题</h2>
        <main>
            <article>文章内容</article>
            <img src="https://storage.360buyimg.com/cjj-pub-images/taro-daily.jpeg" alt="图片" width="100%" height="auto" />
            <p>这是很长一段文字</p>
        </main>
    `
    const [htmlText, setHtmlText] = useState(html)
    const handleClick = () => {
        setHtmlText(html + `<footer>这里是页脚</footer>`)
    }
return (
        <View>
            <View>我的</View>
            <View>
                <wxParse nodes={htmlText} />
            </View>
            <Button type='primary' onClick={handleClick}>改变html</Button>
        </View>
    )
}
export default Page

当我点击按钮改变html的时候,图片一直会显示loading状态而不显示出图片来,麻烦看下这个bug呢?开源不易 ,万分感谢!

@Vinsurs 控制台有报错吗

@Vinsurs
Copy link
Author

Vinsurs commented Mar 9, 2022

@csonchen 没报错信息哦, 就一直是loading状态,但是点击它预览的时候是有图片出来的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants