-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMain.fs
More file actions
43 lines (34 loc) · 1.05 KB
/
Main.fs
File metadata and controls
43 lines (34 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
module App
open Browser.Dom
open Fable.Core.JsInterop
open Counter
// Import CSS and SVG files
importSideEffects "./style.css"
let viteLogo: string = importDefault "./assets/vite.svg"
printfn $"{viteLogo}"
let javascriptLogo : string = importDefault "./javascript.svg"
printfn $"{javascriptLogo}"
// make html markup available using vscode F# html ext
let html = id
// Create the HTML content
let app = document.querySelector("#app")
app.innerHTML <-
html $"""
<div>
<a href="https://vite.dev" target="_blank">
<img src="{viteLogo}" class="logo" alt="Vite logo" />
</a>
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" target="_blank">
<img src="{javascriptLogo}" class="logo vanilla" alt="JavaScript logo" />
</a>
<h1>Hello Vite!</h1>
<div class="card">
<button id="counter" type="button"></button>
</div>
<p class="read-the-docs">
Click on the Vite logo to learn more
</p>
</div>
"""
document.querySelector("#counter")
|> Counter.setupCounter