使用 idb-keyval
This commit is contained in:
18
demo.html
18
demo.html
@@ -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>
|
||||
|
Reference in New Issue
Block a user