使用 idb-keyval

This commit is contained in:
2023-10-21 02:26:42 +08:00
parent 6f267109a4
commit 5c00514610
3 changed files with 69 additions and 36 deletions

View File

@@ -8,7 +8,23 @@
</head>
<body>
<script type="module">
import './src/store.js'
import { musicStore, chatStore } from './src/store.js'
console.log(musicStore.name)
console.log(chatStore.name)
// 检查过期的消息自动销毁
// 查询消息列表
const element = document.createElement('div')
element.innerHTML = `
<h1>DEMO</h1>
<h2>音乐</h2>
<div id="music">${musicStore.name}</div>
<h2>聊天</h2>
<div id="chat">${chatStore.name}</div>
`
document.body.appendChild(element)
</script>
</body>
</html>