-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathindex.js
46 lines (41 loc) · 825 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import Vue from 'vue'
import { VueEmotion, styled } from '@egoist/vue-emotion'
Vue.use(VueEmotion)
const Button = styled('button')`
color: ${props => props.theme.color};
font-size: 1rem;
`
const BlueButton = styled(Button)`
color: blue;
font-size: 33px;
background: yellow;
`
const Input = styled('input')`
border: 1px solid #e2e2e2;
padding: 10px;
font-size: 1rem;
`
new Vue({
el: '#app',
data: {
count: 0,
initialInput: 'some text'
},
provide() {
return {
theme: {
color: 'green'
}
}
},
render() {
return (
<div>
<Button onClick={() => this.count++}>{this.count}</Button>
<BlueButton onClick={() => this.count++}>{this.count * 2}</BlueButton>
<hr />
<Input value={this.initialInput} />
</div>
)
}
})