Skip to content

Instantly share code, notes, and snippets.

@ljmotta
Last active October 14, 2020 18:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
TodoListWebview HTML
public open(pageId: string, opts: { onClose: () => void }) {
// ...
const scriptSrc = webviewPanel.webview
.asWebviewUri(Uri.file(this.context.asAbsolutePath(this.envelopeLocator.envelopePath)))
.toString();
webviewPanel.webview.html = `<!DOCTYPE html>
<html lang="en">
<head>
<style>
html, body, div#envelope-app {
margin: 0;
border: 0;
padding: 10px;
}
</style>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div id="envelope-app" />
<script src="${scriptSrc}"></script>
</body>
</html>`;
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment