Commit 42f644a31c525d45b78f29f1cd3ae6ddaf09f814

Authored by 梁灏
1 parent 492f652b

add CSS

examples/routers/time.vue
1 <template> 1 <template>
2 <div> 2 <div>
3 - <Time /> 3 + <Time :time="1526552777" />
4 </div> 4 </div>
5 </template> 5 </template>
6 <script> 6 <script>
src/components/time/time.vue
1 <template> 1 <template>
2 - <span :class="classes" @click="handleClick">time</span> 2 + <span :class="classes" @click="handleClick">{{ date }}</span>
3 </template> 3 </template>
4 <script> 4 <script>
5 import Vue from 'vue'; 5 import Vue from 'vue';
@@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
51 if (this.hash !== '') window.location.hash = this.hash; 51 if (this.hash !== '') window.location.hash = this.hash;
52 }, 52 },
53 setTime () { 53 setTime () {
54 - 54 + this.date = this.time;
55 } 55 }
56 }, 56 },
57 mounted () { 57 mounted () {
src/styles/components/index.less
@@ -44,3 +44,4 @@ @@ -44,3 +44,4 @@
44 @import "avatar"; 44 @import "avatar";
45 @import "color-picker"; 45 @import "color-picker";
46 @import "auto-complete"; 46 @import "auto-complete";
  47 +@import "time";
47 \ No newline at end of file 48 \ No newline at end of file
src/styles/components/time.less 0 → 100644
  1 +@time-prefix-cls: ~"@{css-prefix}time";
  2 +
  3 +.@{time-prefix-cls} {
  4 + &-with-hash{
  5 + cursor: pointer;
  6 + &:hover{
  7 + text-decoration: underline;
  8 + }
  9 + }
  10 +}
0 \ No newline at end of file 11 \ No newline at end of file