:construction:🎨 Site > Improve structure/build and add example
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<template src="./template.html"></template>
|
||||
<script src="./script.js"></script>
|
||||
<style src="./style.styl" lang="stylus"></style>
|
||||
@@ -0,0 +1,29 @@
|
||||
import socketIoClient from 'socket.io-client'
|
||||
|
||||
export default
|
||||
{
|
||||
name: 'application',
|
||||
|
||||
data()
|
||||
{
|
||||
return {
|
||||
counter: 0
|
||||
}
|
||||
},
|
||||
|
||||
mounted()
|
||||
{
|
||||
const socketUrl = `${process.env === 'production' ? '' : 'http://192.168.1.12:1571/projects'}`
|
||||
const socket = socketIoClient(socketUrl)
|
||||
|
||||
socket.on('connect', () =>
|
||||
{
|
||||
console.log('connected')
|
||||
})
|
||||
|
||||
window.setInterval(() =>
|
||||
{
|
||||
this.counter++
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
#application
|
||||
background #f0f
|
||||
@@ -0,0 +1,3 @@
|
||||
<div id="application">
|
||||
{{ counter }}
|
||||
</div>
|
||||
Reference in New Issue
Block a user