van-hmr/app.js

33 lines
563 B
JavaScript
Raw Permalink Normal View History

2025-02-07 09:58:54 -05:00
const CSS = Gale({
Button:{
padding: "20px",
2025-02-07 15:17:25 -05:00
background: "blue",
2025-02-07 09:58:54 -05:00
borderRadius: "20px",
color: "white",
2025-02-07 15:17:25 -05:00
fontWeight: "bolder",
":hover":{
background: "yellow"
}
2025-02-06 14:32:07 -05:00
}
2025-02-07 15:17:25 -05:00
});
2025-02-07 09:58:54 -05:00
2025-02-07 15:17:25 -05:00
const state = vanX.reactive({key1:"value1", key2:"value2", count:7}, "THING")
2025-02-07 09:58:54 -05:00
console.log(state);
2025-02-07 15:17:25 -05:00
van.add
2025-02-07 09:58:54 -05:00
(
document.body,
2025-02-07 15:17:25 -05:00
van.tags.div
2025-02-07 09:58:54 -05:00
(
{
class:CSS("Button"),
onclick()
{
state.count++;
}
}
, ()=>state.count
)
);