https://github.com/devhau/sokeio-example
https://github.com/devhau/sokeio-example
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/devhau/sokeio-example
- Owner: devhau
- Created: 2024-11-18T11:14:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-18T13:52:20.000Z (over 1 year ago)
- Last Synced: 2025-10-20T16:48:53.321Z (7 months ago)
- Language: HTML
- Homepage: https://devhau.github.io/sokeio-example/
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sokeio Example
```
const template={
state: {
count: 0,
},
updateTime() {
setTimeout(() => {
this.count = new Date();
this.updateTime();
}, 1000);
},
ready() {
this.updateTime();
},
render() {
return `<div>
<h1>hello world</h1>
<p so-text="count">dfdfdfdf</p>
<button class="btn btn-primary" so-on:click="count++;">click</button>
</div>`;
}
};
export default {
components: {
'sokeio::template': template
},
state: {
count: 0,
},
updateTime() {
setTimeout(() => {
this.count = new Date();
this.updateTime();
}, 1000);
},
ready() {
this.updateTime();
},
render() {
return `<div>
<h1>hello world</h1>
<p so-text="count">dfdfdfdf</p>
<button class="btn btn-primary" so-on:click="count++;">click</button>
<button class="btn btn-primary" so-on:click="refresh();">Refresh</button>
[sokeio::template/]
</div>`;
},
};
```