Big Bang
This commit is contained in:
27
example/HelloWorld.component.js
Normal file
27
example/HelloWorld.component.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Component } from './vues6.js'
|
||||
|
||||
const template = `
|
||||
<div>
|
||||
<h1>{{ message }} (Changes: {{ changes }})</h1>
|
||||
<h2>{{ tagline }}</h2>
|
||||
<button type="button" @click="onClick">Click Me!</button>
|
||||
<input type="text" v-model="message">
|
||||
</div>
|
||||
`
|
||||
|
||||
export default class HelloWorldComponent {
|
||||
static get selector() { return 'hello-world' }
|
||||
static get props() { return ['tagline'] }
|
||||
static get template() { return template }
|
||||
|
||||
message = 'Hello World'
|
||||
changes = 0
|
||||
|
||||
onClick() {
|
||||
this.message += '!'
|
||||
}
|
||||
|
||||
watch_message(nv, ov) {
|
||||
this.changes += 1
|
||||
}
|
||||
}
|
||||
7
example/components.js
Normal file
7
example/components.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import HelloWorldComponent from './HelloWorld.component.js'
|
||||
|
||||
const components = {
|
||||
HelloWorldComponent,
|
||||
}
|
||||
|
||||
export { components }
|
||||
25
example/index.html
Normal file
25
example/index.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>VuES6 Test</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="vue-app">
|
||||
<hello-world tagline="This is a test!"></hello-world>
|
||||
</div>
|
||||
<script src="vue-2.6.11.js"></script>
|
||||
<script src="vues6.js" type="module"></script>
|
||||
<script type="module">
|
||||
import { components } from './components.js'
|
||||
import VuES6Loader from './vues6.js'
|
||||
|
||||
const loader = new VuES6Loader(components)
|
||||
loader.load()
|
||||
|
||||
const app = new Vue({
|
||||
el: '#vue-app',
|
||||
data: {}
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
11965
example/vue-2.6.11.js
Normal file
11965
example/vue-2.6.11.js
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user