Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sample
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周韬
node-sample
Commits
ed76f833
Commit
ed76f833
authored
Nov 30, 2016
by
Evan You
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak comment collapse styling
parent
096e7f5c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
+22
-14
Comment.vue
src/components/Comment.vue
+22
-14
No files found.
src/components/Comment.vue
View file @
ed76f833
...
@@ -3,13 +3,15 @@
...
@@ -3,13 +3,15 @@
<div
class=
"by"
>
<div
class=
"by"
>
<router-link
:to=
"'/user/' + comment.by"
>
{{
comment
.
by
}}
</router-link>
<router-link
:to=
"'/user/' + comment.by"
>
{{
comment
.
by
}}
</router-link>
{{
comment
.
time
|
timeAgo
}}
ago
{{
comment
.
time
|
timeAgo
}}
ago
<span
v-if=
"comment.kids && comment.kids.length"
>
|
<a
class=
"expand"
@
click=
"open = !open"
>
{{
(
open
?
'collapse '
:
'expand '
)
+
pluralize
(
comment
.
kids
.
length
)
}}
</a>
</span>
</div>
</div>
<div
class=
"text"
v-html=
"comment.text"
></div>
<div
class=
"text"
v-html=
"comment.text"
></div>
<div
class=
"toggle"
:class=
"
{ open }" v-if="comment.kids
&&
comment.kids.length">
<a
@
click=
"open = !open"
>
{{
open
?
'[-]'
:
'[+] '
+
pluralize
(
comment
.
kids
.
length
)
+
' collapsed'
}}
</a>
</div>
<ul
class=
"comment-children"
v-show=
"open"
>
<ul
class=
"comment-children"
v-show=
"open"
>
<comment
v-for=
"id in comment.kids"
:id=
"id"
></comment>
<comment
v-for=
"id in comment.kids"
:id=
"id"
></comment>
</ul>
</ul>
...
@@ -31,9 +33,7 @@ export default {
...
@@ -31,9 +33,7 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
pluralize
(
n
)
{
pluralize
:
n
=>
n
+
(
n
===
1
?
' reply'
:
' replies'
)
return
n
+
(
n
===
1
?
' reply'
:
' replies'
)
}
}
}
}
}
</
script
>
</
script
>
...
@@ -41,19 +41,16 @@ export default {
...
@@ -41,19 +41,16 @@ export default {
<
style
lang=
"stylus"
>
<
style
lang=
"stylus"
>
.comment-children
.comment-children
.comment-children
.comment-children
margin-left 1em
margin-left 1
.5
em
.comment
.comment
border-top 1px solid #eee
border-top 1px solid #eee
position relative
position relative
.expand
.by, .text, .toggle
cursor pointer
.by, .text
font-size .9em
font-size .9em
padding
1em 0
margin
1em 0
.by
.by
color #999
color #999
padding-bottom 0
a
a
color #999
color #999
text-decoration underline
text-decoration underline
...
@@ -61,4 +58,15 @@ export default {
...
@@ -61,4 +58,15 @@ export default {
overflow-wrap break-word
overflow-wrap break-word
a:hover
a:hover
color #ff6600
color #ff6600
.toggle
background-color #fffbf2
padding .3em .5em
border-radius 4px
a
color #999
cursor pointer
&.open
padding 0
background-color transparent
margin-bottom -0.5em
</
style
>
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment