23 lines
550 B
Text
23 lines
550 B
Text
---
|
|
import Serialize from "../Serialize.astro";
|
|
const data = {
|
|
name: 'John Doe',
|
|
isOkay: true,
|
|
mood: null,
|
|
// now: new Date(),
|
|
// age: BigInt('3218378192378')
|
|
}
|
|
export type Data = typeof data;
|
|
---
|
|
|
|
<div id="render-here"></div>
|
|
<Serialize data={data} id="my-data" />
|
|
|
|
<script>
|
|
import { deserialize } from '../deserialize';
|
|
import type { Data } from './index.astro';
|
|
|
|
const data = deserialize<Data>('my-data');
|
|
console.log(data);
|
|
document.getElementById("render-here").innerHTML = JSON.stringify(data)
|
|
</script>
|