Skip to content
Discussion options

You must be logged in to vote

Hey! In Taro, to display a static HTML file in a Webview, you can bundle the HTML with your app. Place the HTML file in your project directory and reference it using a relative path that gets copied to the dist folder. Alternatively, embed the HTML as a data URL: src='data:text/html;charset=utf-8,' + encodeURIComponent(yourHtmlString). Ensure the Webview component is configured to allow local file access on the target platform. This works for WeChat mini program and other Taro targets.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by andri2621
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q & A
Labels
None yet
2 participants