Skip to content

Commit 41f1216

Browse files
committedSep 19, 2016
4 space indent master race
1 parent a50ec93 commit 41f1216

File tree

3 files changed

+85
-86
lines changed

3 files changed

+85
-86
lines changed
 

‎.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ module.exports = {
7373
"id-blacklist": "error",
7474
"id-length": "error",
7575
"id-match": "error",
76-
"indent": "off",
76+
"indent": ["error", 4],
7777
"init-declarations": "error",
7878
"jsx-quotes": "error",
7979
"key-spacing": "error",

‎server.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ const models = require('./models')(db);
2424
app.use('/', require('./routes')(models, socket));
2525

2626
function normalizePort(val) {
27-
const port = parseInt(val, 10);
28-
if (isNaN(port)) {
29-
// named pipe
30-
return val;
31-
}
32-
if (port >= 0) {
33-
// port number
34-
return port;
35-
}
27+
const port = parseInt(val, 10);
28+
if (isNaN(port)) {
29+
// named pipe
30+
return val;
31+
}
32+
if (port >= 0) {
33+
// port number
34+
return port;
35+
}
3636

37-
return false;
37+
return false;
3838
}

‎src/components/Post.vue

+74-75
Original file line numberDiff line numberDiff line change
@@ -15,91 +15,90 @@
1515

1616
<script>
1717
const slots = [
18-
'title',
19-
'subtitle',
20-
'supportingText',
21-
'media',
22-
'actions',
23-
'menu'
18+
'title',
19+
'subtitle',
20+
'supportingText',
21+
'media',
22+
'actions',
23+
'menu'
2424
]
2525
2626
export default {
27-
computed: {
28-
isActionsURL() {
29-
if (typeof this.actions === 'string') {
30-
return this.actions.match(/^(https?:)?\/\//) !== null
31-
}
27+
computed: {
28+
isActionsURL() {
29+
if (typeof this.actions === 'string') {
30+
return this.actions.match(/^(https?:)?\/\//) !== null
31+
}
3232
33-
return false
34-
},
35-
supportingText() {
36-
return this.post.body
37-
},
38-
subtitle() {
39-
const formattedDate = new Date(this.post.created_at)
40-
.toString()
41-
.split(' ')
42-
.slice(0, 5)
43-
.join(' ')
33+
return false
34+
},
35+
supportingText() {
36+
return this.post.body
37+
},
38+
subtitle() {
39+
const formattedDate = new Date(this.post.created_at)
40+
.toString()
41+
.split(' ')
42+
.slice(0, 5)
43+
.join(' ')
4444
45-
return `
46-
<span class="post-timestamp">${formattedDate}</span>
47-
<span class="post-id">${this.post._id}</span>
48-
`
49-
}
50-
},
51-
props: {
52-
title: {
53-
type: String,
54-
default: true
55-
},
56-
menu: {
57-
default: true
58-
},
59-
actions: {
60-
type: String,
61-
default: true
62-
},
63-
actionsTarget: {
64-
default: '_self',
65-
type: String
66-
},
67-
actionsText: String,
68-
media: {
69-
default: true,
70-
type: String
45+
return `
46+
<span class="post-timestamp">${formattedDate}</span>
47+
<span class="post-id">${this.post._id}</span>
48+
`
49+
}
7150
},
72-
subtitle: {
73-
default: true,
74-
type: String
51+
props: {
52+
title: {
53+
type: String,
54+
default: true
55+
},
56+
menu: {
57+
default: true
58+
},
59+
actions: {
60+
type: String,
61+
default: true
62+
},
63+
actionsTarget: {
64+
default: '_self',
65+
type: String
66+
},
67+
actionsText: String,
68+
media: {
69+
default: true,
70+
type: String
71+
},
72+
subtitle: {
73+
default: true,
74+
type: String
75+
},
76+
supportingText: {
77+
default: true,
78+
type: String
79+
},
80+
post: {
81+
default: true
82+
}
7583
},
76-
supportingText: {
77-
default: true,
78-
type: String
84+
compiled() {
85+
slots.forEach((slot, pos) => {
86+
if (this[slot] === true) {
87+
const el = this.$el.children[pos]
88+
if (!el || !el.attributes.getNamedItem('slot')) {
89+
this[slot] = ''
90+
}
91+
}
92+
})
7993
},
80-
post: {
81-
default: true
82-
}
83-
},
84-
compiled() {
85-
slots.forEach((slot, pos) => {
86-
if (this[slot] === true) {
87-
const el = this.$el.children[pos]
88-
if (!el || !el.attributes.getNamedItem('slot')) {
89-
this[slot] = ''
94+
methods: {
95+
triggerMenuEvent() {
96+
this.$dispatch(this.menu)
97+
},
98+
triggerActionsEvent() {
99+
this.$dispatch(this.actions)
90100
}
91-
}
92-
})
93-
// el = @$el.children[pos]?.attributes.getNamedItem 'slot'
94-
},
95-
methods: {
96-
triggerMenuEvent() {
97-
this.$dispatch(this.menu)
98-
},
99-
triggerActionsEvent() {
100-
this.$dispatch(this.actions)
101101
}
102-
}
103102
}
104103
</script>
105104

0 commit comments

Comments
 (0)
Please sign in to comment.