work in progress: frontend functionality with petite-vue
This commit is contained in:
parent
3ef54f0d42
commit
56edced4ab
3 changed files with 27 additions and 8 deletions
|
@ -1,2 +0,0 @@
|
|||
|
||||
PetiteVue.createApp({$delimiters: ['{|', '|}']}).mount()
|
26
assets/js/main.ts
Normal file
26
assets/js/main.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
import { createApp } from './lib/petite-vue.es.js'
|
||||
|
||||
createApp({
|
||||
$delimiters: ['{|', '|}'],
|
||||
urlParams: new URL(location.href).searchParams,
|
||||
save
|
||||
}).mount()
|
||||
|
||||
function save(text: string) {
|
||||
console.log(text)
|
||||
}
|
||||
|
||||
const s: string = 'test-string'
|
||||
save(s)
|
||||
|
||||
for (let i = 0; i < 10; i++) {
|
||||
setTimeout(function () {
|
||||
console.log(i);
|
||||
}, 100 * i);
|
||||
}
|
||||
|
||||
// p = new URL(location.href).searchParams
|
||||
// id = p.get('id')
|
||||
|
||||
// fetch('http://localhost:8125/api/system/poll/service/pclt-0001').
|
||||
// then((res) => res.json()).then((data) => console.log(data))
|
|
@ -1,7 +1,2 @@
|
|||
<!--<script src="https://unpkg.com/petite-vue"></script>-->
|
||||
<script src="js/lib/petite-vue.iife.js"></script>
|
||||
{{ $js := resources.Get "js/index.ts" | js.Build }}
|
||||
{{ $js := resources.Get "js/main.ts" | js.Build (dict "minify" false) }}
|
||||
<script src="{{ $js.Permalink }}"></script>
|
||||
<!--<script>
|
||||
PetiteVue.createApp({$delimiters: ['{|', '|}']}).mount()
|
||||
</script>-->
|
||||
|
|
Loading…
Add table
Reference in a new issue