Front-end JavaScript framework
🙂
<script src="https://unpkg.com/vue@2.5.9/dist/vue.js"></script>
<div id="app">
<p>{{text}}</p>
</div>
<script>
new Vue({
el: '#app',
data: () => ({
text: 'Hello, world!'
})
})
</script>
Plain HTML file
Â
the documentation is the only tutorial you'll ever need
China, USA, Japan, UK, Vietnam, France, Russia, Poland, Germany, India
(not opt-out)
declarative
rendering
component
system
client-side
routingÂ
state
management
build
system
source: http://bit.ly/2nMKlcy
(collocation)
JS
HTML
CSS
<template>
<div>
Counter: {{counter}}
<button onClick="counter++">+</button>
</div>
</template>
<script>
export default {
data: () => ({
counter: 0
})
}
</script>
<style scoped>
div {
color: steelblue;
}
</style>
Single file component
<template>
<div>
Hello, World!
</div>
</template>
<test>
import Counter from './MyComponent.js'
import { mount } from 'vue-test-utils'
test('renders div', {
const wrapper = mount(Counter)
expect(wrapper.is('div')).toBe(true)
})
</test>
<docs>
## My Component
Renders Hello, World!
</docs>
Custom blocks