File tree Expand file tree Collapse file tree 2 files changed +31
-12
lines changed Expand file tree Collapse file tree 2 files changed +31
-12
lines changed Original file line number Diff line number Diff line change 15
15
{{ item.time | timeAgo }} ago
16
16
</p >
17
17
</div >
18
- <div v-if =" item.kids" class =" item-view-comments" >
19
- <p class =" item-view-comments-header" >{{ item.descendants }} comments</p >
20
- <ul class =" comment-children" >
18
+ <div class =" item-view-comments" >
19
+ <p class =" item-view-comments-header" >
20
+ {{ item.kids ? item.descendants + ' comments' : 'No comments yet.'}}
21
+ </p >
22
+ <ul v-if =" item.kids" class =" comment-children" >
21
23
<comment v-for =" id in item.kids" :id =" id" ></comment >
22
24
</ul >
23
25
</div >
Original file line number Diff line number Diff line change 2
2
<div class =" user-view" >
3
3
<spinner :show =" !user" ></spinner >
4
4
<template v-if =" user " >
5
- <ul >
6
- <li ><span class =" label" >user:</span > {{ user.id }}</li >
7
- <li ><span class =" label" >created:</span > {{ user.created | timeAgo }} ago</li >
8
- <li ><span class =" label" >karma:</span > {{user.karma}}</li >
9
- <li >
10
- <span class =" label" >about:</span >
11
- <div class =" about" v-html =" user.about" ></div >
12
- </li >
5
+ <h1 >User : {{ user.id }}</h1 >
6
+ <ul class =" meta" >
7
+ <li ><span class =" label" >Created:</span > {{ user.created | timeAgo }} ago</li >
8
+ <li ><span class =" label" >Karma:</span > {{user.karma}}</li >
9
+ <li v-if =" user.about" v-html =" user.about" class =" about" ></li >
13
10
</ul >
14
11
<p class =" links" >
15
- <a :href =" 'https://news.ycombinator.com/submitted?id=' + user.id" >submissions</a >< br >
12
+ <a :href =" 'https://news.ycombinator.com/submitted?id=' + user.id" >submissions</a > |
16
13
<a :href =" 'https://news.ycombinator.com/threads?id=' + user.id" >comments</a >
17
14
</p >
18
15
</template >
@@ -42,3 +39,23 @@ export default {
42
39
}
43
40
}
44
41
</script >
42
+
43
+ <style lang="stylus">
44
+ .user-view
45
+ background-color #f f f
46
+ box-sizing border-box
47
+ padding 2em 3em
48
+ h1
49
+ margin 0
50
+ font-size 1.5em
51
+ .meta
52
+ list-style-type none
53
+ padding 0
54
+ .label
55
+ display inline-block
56
+ min-width 4em
57
+ .about
58
+ margin 1em 0
59
+ .links a
60
+ text-decoration underline
61
+ </style >
You can’t perform that action at this time.
0 commit comments