Debian Codegraph @

demo/kitchen-sink/docs/vue.vue

raw
1 <!--
2 Things to verify:
3 - comments (this block) are properly highlighted
4 - expressions are highlighted as JS
5 - <script> highlights ES2015 syntax
6 - <style> highlights as CSS
7 -->
8
9 <template>
10 <div>
11 {{ foo * 10 + 'hi' }}
12 <span
13 v-text="foo * 10 + 'hi'" :id="foo + 'baz'"
14 @click="onClick('hello')"
15 @click.prevent="onClick('hello')">
16 Hello
17 </span>
18 <router-link v-bind:to="item.url"/>
19 <!-- v-bind with dynamic key -->
20 <div v-bind:[key]="value"></div>
21
22 <!-- v-bind shorthand with dynamic key -->
23 <div :[key]="value"></div>
24
25 <!-- v-on with dynamic event -->
26 <div v-on:[event]="handler"></div>
27
28 <!-- v-on shorthand with dynamic event -->
29 <div @[event]="handler"></div>
30 </div>
31 </template>
32
33 <script>
34 export default {
35 data: () => ({
36 foo: 'bar'
37 })
38 };
39 </script>
40
41 <style>
42 div {
43 color: red;
44 }
45 </style>
46
47 <style lang="sass">
48 // sass ace mode;
49
50 @import url(http://fonts.googleapis.com/css?family=Ace:700)
51
52 html, body
53 :background-color #ace
54 text-align: center
55 height: 100%
56 /*;*********;
57 ;comment ;
58 ;*********;
59
60
61 &:before
62 $radius: $size * 0.845
63 $glow: $size * 0.125
64
65 box-shadow: 0 0 $glow $glow / 2 #fff
66 border-radius: $radius
67
68 &:active
69 ~ .button
70 box-shadow: 0 15px 25px -4px rgba(0, 0, 0, 0.4)
71
72 ~ .label
73 font-size: 40px
74 color: rgba(0, 0, 0, 0.45)
75
76 &:checked
77 ~ .button
78 box-shadow: 0 15px 25px -4px #ace
79
80 ~ .label
81 font-size: 40px
82 color: #c9c9c9
83 </style>
84
85 <style lang="scss">
86 /* style.scss */
87
88 #navbar {
89 $navbar-width: 800px;
90 $items: 5;
91 $navbar-color: #ce4dd6;
92
93 width: $navbar-width;
94 border-bottom: 2px solid $navbar-color;
95
96 li {
97 float: left;
98 width: $navbar-width/$items - 10px;
99
100 background-color: lighten($navbar-color, 20%);
101
102 &:hover {
103 background-color: lighten($navbar-color, 10%);
104 }
105 }
106 }
107
108 </style>
109
110 <template lang="jade">
111 mixin article(obj, parents)
112 -var x = "0";
113
114 - var items = ["one", "two", "three"]
115 each item in items
116 li= item
117 </template>
118
119 <template v-slot:item.parentkey.subkey.subkey.subkey.subkey.subkey="{ value }"></template>