Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit de65d1d

Browse files
authored
Merge pull request #13 from wearelucid/develop
Update to Prettier 2.0
2 parents 9065270 + 45f18d7 commit de65d1d

21 files changed

+14894
-13163
lines changed

‎.eslintrc.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
},
88
parserOptions: {
99
parser: 'babel-eslint',
10-
'sourceType': 'module'
10+
sourceType: 'module'
1111
},
1212
extends: [
1313
'eslint:recommended',
@@ -40,8 +40,8 @@ module.exports = {
4040
{
4141
singleQuote: true,
4242
semi: false,
43-
endOfLine:"auto"
43+
endOfLine:'auto'
4444
}
45-
],
45+
]
4646
}
4747
}

‎.nvmrc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.15.0
1+
12.16.3

‎components/Example1.vue‎

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
<script>
2-
export default {
3-
name: 'Example1',
4-
data() {
5-
return {
6-
response: '',
7-
error: null
8-
}
9-
},
10-
methods: {
11-
async helloWorld() {
12-
try {
13-
const res = await this.$axios.$get('/.netlify/functions/hello-world')
14-
this.response = res
15-
this.error = null
16-
} catch (e) {
17-
this.error = e.response
18-
this.response = ''
19-
}
20-
}
21-
}
22-
}
23-
</script>
24-
25-
<template>
26-
<div>
27-
<h2>1. Hello, World!</h2>
28-
<ElButton @click="helloWorld()"type="primary" data-cy="btn-hello-world"
29-
>Hello</ElButton
30-
>
31-
<p>Response: {{ response }}</p>
32-
<p v-if="error" style="color:red;">
33-
<strong>Error {{ error.status }}</strong>
34-
<br />
35-
{{ error.data }}
36-
</p>
37-
</div>
38-
</template>
1+
<script>
2+
export default {
3+
name: 'Example1',
4+
data() {
5+
return {
6+
response: '',
7+
error: null,
8+
}
9+
},
10+
methods: {
11+
async helloWorld() {
12+
try {
13+
const res = await this.$axios.$get('/.netlify/functions/hello-world')
14+
this.response = res
15+
this.error = null
16+
} catch (e) {
17+
this.error = e.response
18+
this.response = ''
19+
}
20+
},
21+
},
22+
}
23+
</script>
24+
25+
<template>
26+
<div>
27+
<h2>1. Hello, World!</h2>
28+
<ElButton type="primary" data-cy="btn-hello-world"@click="helloWorld()"
29+
>Hello</ElButton
30+
>
31+
<p>Response: {{ response }}</p>
32+
<p v-if="error" style="color:red;">
33+
<strong>Error {{ error.status }}</strong>
34+
<br />
35+
{{ error.data }}
36+
</p>
37+
</div>
38+
</template>

‎components/Example2.vue‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ export default {
44
data() {
55
return {
66
form: {
7-
name: ''
7+
name: '',
88
},
99
response: '',
10-
error: null
10+
error: null,
1111
}
1212
},
1313
methods: {
@@ -22,19 +22,19 @@ export default {
2222
this.error = e.response
2323
this.response = ''
2424
}
25-
}
26-
}
25+
},
26+
},
2727
}
2828
</script>
2929

3030
<template>
3131
<ElForm
3232
ref="form"
3333
:model="form"
34-
@submit.native.prevent="helloName(form.name)"
3534
inline
3635
label-width="auto"
3736
label-position="left"
37+
@submit.native.prevent="helloName(form.name)"
3838
>
3939
<h2>2. Hello, {name}</h2>
4040
<ElFormItem label="Name">
@@ -46,14 +46,14 @@ export default {
4646
/>
4747
</ElFormItem>
4848
<ElButton
49-
@click="helloName(form.name)"
5049
type="primary"
5150
data-cy="btn-hello-name"
51+
@click="helloName(form.name)"
5252
>
5353
👋 Say hello
5454
</ElButton>
5555
<p>Response: {{ response }}</p>
56-
<p v-if="error" style="color:red;">
56+
<p v-if="error" style="color:red;">
5757
<strong>Error {{ error.status }}</strong>
5858
<br />
5959
{{ error.data }}

‎components/Example3.vue‎

Lines changed: 81 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,81 @@
1-
<script>
2-
export default {
3-
name: 'Example3',
4-
data() {
5-
return {
6-
form: {
7-
name: ''
8-
},
9-
response: '',
10-
error: null
11-
}
12-
},
13-
methods: {
14-
async helloNamePost(name) {
15-
try {
16-
const res = await this.$axios.$post(
17-
'/.netlify/functions/hello-name-post',
18-
{ name }
19-
)
20-
this.response = res
21-
this.error = null
22-
} catch (e) {
23-
this.error = e.response
24-
this.response = ''
25-
}
26-
},
27-
async helloNamePostError(name) {
28-
try {
29-
const res = await this.$axios.$get(
30-
`/.netlify/functions/hello-name-post?name=${name}`
31-
)
32-
this.response = res
33-
this.error = null
34-
} catch (e) {
35-
this.error = e.response
36-
this.response = ''
37-
}
38-
}
39-
}
40-
}
41-
</script>
42-
43-
<template>
44-
<ElForm
45-
ref="form"
46-
:model="form"
47-
@submit.native.prevent="helloNamePost(form.name)"
48-
inline
49-
label-width="auto"
50-
label-position="left"
51-
>
52-
<h2>3. Hello, {name} (POST version)</h2>
53-
<ElFormItem label="Name">
54-
<ElInput
55-
v-model="form.name"
56-
placeholder="Your name"
57-
data-cy="input-hello-name-post"
58-
/>
59-
</ElFormItem>
60-
<ElButton
61-
@click="helloNamePost(form.name)"
62-
type="primary"
63-
data-cy="btn-hello-name-post"
64-
>
65-
👋 Say hello
66-
</ElButton>
67-
<ElButton
68-
@click="helloNamePostError(form.name)"
69-
type="danger"
70-
data-cy="btn-hello-name-post-error"
71-
>
72-
.$get() Error
73-
</ElButton>
74-
<p>Response: {{ response }}</p>
75-
<p v-if="error" style="color:red;">
76-
<strong>Error {{ error.status }}</strong>
77-
<br />
78-
{{ error.data }}
79-
</p>
80-
</ElForm>
81-
</template>
1+
<script>
2+
export default {
3+
name: 'Example3',
4+
data() {
5+
return {
6+
form: {
7+
name: '',
8+
},
9+
response: '',
10+
error: null,
11+
}
12+
},
13+
methods: {
14+
async helloNamePost(name) {
15+
try {
16+
const res = await this.$axios.$post(
17+
'/.netlify/functions/hello-name-post',
18+
{ name }
19+
)
20+
this.response = res
21+
this.error = null
22+
} catch (e) {
23+
this.error = e.response
24+
this.response = ''
25+
}
26+
},
27+
async helloNamePostError(name) {
28+
try {
29+
const res = await this.$axios.$get(
30+
`/.netlify/functions/hello-name-post?name=${name}`
31+
)
32+
this.response = res
33+
this.error = null
34+
} catch (e) {
35+
this.error = e.response
36+
this.response = ''
37+
}
38+
},
39+
},
40+
}
41+
</script>
42+
43+
<template>
44+
<ElForm
45+
ref="form"
46+
:model="form"
47+
inline
48+
label-width="auto"
49+
label-position="left"
50+
@submit.native.prevent="helloNamePost(form.name)"
51+
>
52+
<h2>3. Hello, {name} (POST version)</h2>
53+
<ElFormItem label="Name">
54+
<ElInput
55+
v-model="form.name"
56+
placeholder="Your name"
57+
data-cy="input-hello-name-post"
58+
/>
59+
</ElFormItem>
60+
<ElButton
61+
type="primary"
62+
data-cy="btn-hello-name-post"
63+
@click="helloNamePost(form.name)"
64+
>
65+
👋 Say hello
66+
</ElButton>
67+
<ElButton
68+
type="danger"
69+
data-cy="btn-hello-name-post-error"
70+
@click="helloNamePostError(form.name)"
71+
>
72+
.$get() Error
73+
</ElButton>
74+
<p>Response: {{ response }}</p>
75+
<p v-if="error" style="color:red;">
76+
<strong>Error {{ error.status }}</strong>
77+
<br />
78+
{{ error.data }}
79+
</p>
80+
</ElForm>
81+
</template>

‎components/Example4.vue‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ export default {
44
data() {
55
return {
66
form: {
7-
name: ''
7+
name: '',
88
},
99
response: null,
10-
error: null
10+
error: null,
1111
}
1212
},
1313
methods: {
@@ -22,19 +22,19 @@ export default {
2222
this.error = e.response
2323
this.response = null
2424
}
25-
}
26-
}
25+
},
26+
},
2727
}
2828
</script>
2929

3030
<template>
3131
<ElForm
3232
ref="form"
3333
:model="form"
34-
@submit.native.prevent="randomCat(form.name)"
3534
inline
3635
label-width="auto"
3736
label-position="left"
37+
@submit.native.prevent="randomCat(form.name)"
3838
>
3939
<h2>4. Get a random cat with your name</h2>
4040
<p><em>API call done by your browser</em></p>
@@ -47,9 +47,9 @@ export default {
4747
/>
4848
</ElFormItem>
4949
<ElButton
50-
@click="randomCat(form.name)"
5150
type="primary"
5251
data-cy="btn-random-cat"
52+
@click="randomCat(form.name)"
5353
>
5454
🐈 Meow
5555
</ElButton>
@@ -61,10 +61,10 @@ export default {
6161
v-show="response"
6262
:src="response"
6363
data-cy="img-random-cat"
64-
style="width:100%;height:auto;"
64+
style="width:100%;height:auto;"
6565
/>
6666
</p>
67-
<p v-if="error" style="color:red;">
67+
<p v-if="error" style="color:red;">
6868
<strong>Error {{ error.status }}</strong>
6969
<br />
7070
{{ error.data }}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /