Skip to content

Commit 30e76b5

Browse files
committed
chore: linting
1 parent 7a5e8e5 commit 30e76b5

File tree

10 files changed

+199
-195
lines changed

10 files changed

+199
-195
lines changed

components/Example1.vue

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
<template>
2+
<div>
3+
<h2>1. Hello, World!</h2>
4+
<ElButton type="primary" data-cy="btn-hello-world" @click="helloWorld()"
5+
>Hello</ElButton
6+
>
7+
<p>Response: {{ response }}</p>
8+
<p v-if="error" style="color: red">
9+
<strong>Error {{ error.status }}</strong>
10+
<br />
11+
{{ error.data }}
12+
</p>
13+
</div>
14+
</template>
15+
116
<script>
217
export default {
318
name: 'Example1',
@@ -21,18 +36,3 @@ export default {
2136
},
2237
}
2338
</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: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1-
<script>
2-
export default {
3-
name: 'Example2',
4-
data() {
5-
return {
6-
form: {
7-
name: '',
8-
},
9-
response: '',
10-
error: null,
11-
}
12-
},
13-
methods: {
14-
async helloName(name) {
15-
try {
16-
const res = await this.$axios.$get(
17-
`/.netlify/functions/hello-name?name=${name}`
18-
)
19-
this.response = res
20-
this.error = null
21-
} catch (e) {
22-
this.error = e.response
23-
this.response = ''
24-
}
25-
},
26-
},
27-
}
28-
</script>
29-
301
<template>
312
<ElForm
323
ref="form"
@@ -60,3 +31,32 @@ export default {
6031
</p>
6132
</ElForm>
6233
</template>
34+
35+
<script>
36+
export default {
37+
name: 'Example2',
38+
data() {
39+
return {
40+
form: {
41+
name: '',
42+
},
43+
response: '',
44+
error: null,
45+
}
46+
},
47+
methods: {
48+
async helloName(name) {
49+
try {
50+
const res = await this.$axios.$get(
51+
`/.netlify/functions/hello-name?name=${name}`
52+
)
53+
this.response = res
54+
this.error = null
55+
} catch (e) {
56+
this.error = e.response
57+
this.response = ''
58+
}
59+
},
60+
},
61+
}
62+
</script>

components/Example3.vue

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

components/Example5.vue

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
<template>
2+
<ElForm
3+
ref="form"
4+
:model="form"
5+
inline
6+
label-width="auto"
7+
label-position="left"
8+
@submit.native.prevent="icanhazip()"
9+
>
10+
<h2>5. icanhazip.com</h2>
11+
<p><em>API call done by lambda function</em></p>
12+
<p>Your IP: {{ ip }}</p>
13+
<ElButton type="primary" @click="icanhazip()">
14+
🤖 Haz AWS IP please
15+
</ElButton>
16+
<ElButton type="info" @click="response = '—'">Clear</ElButton>
17+
<p>Response: {{ response }}</p>
18+
<p v-if="error" style="color: red">
19+
<strong>Error {{ error.status }}</strong>
20+
<br />
21+
{{ error.data }}
22+
</p>
23+
</ElForm>
24+
</template>
25+
126
<script>
227
export default {
328
name: 'Example5',
@@ -36,28 +61,3 @@ export default {
3661
},
3762
}
3863
</script>
39-
40-
<template>
41-
<ElForm
42-
ref="form"
43-
:model="form"
44-
inline
45-
label-width="auto"
46-
label-position="left"
47-
@submit.native.prevent="icanhazip()"
48-
>
49-
<h2>5. icanhazip.com</h2>
50-
<p><em>API call done by lambda function</em></p>
51-
<p>Your IP: {{ ip }}</p>
52-
<ElButton type="primary" @click="icanhazip()">
53-
🤖 Haz AWS IP please
54-
</ElButton>
55-
<ElButton type="info" @click="response = '—'">Clear</ElButton>
56-
<p>Response: {{ response }}</p>
57-
<p v-if="error" style="color: red">
58-
<strong>Error {{ error.status }}</strong>
59-
<br />
60-
{{ error.data }}
61-
</p>
62-
</ElForm>
63-
</template>

components/Example6.vue

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
<template>
2+
<ElForm
3+
ref="mailgunForm"
4+
:rules="rules"
5+
:model="form"
6+
label-width="80px"
7+
label-position="left"
8+
>
9+
<h2>
10+
6. Send form submission with
11+
<a href="https://www.mailgun.com/" target="_blank">Mailgun</a>
12+
</h2>
13+
<ElFormItem label="Name" prop="name">
14+
<ElInput v-model="form.name" placeholder="Your name" required />
15+
</ElFormItem>
16+
<ElFormItem label="Email" prop="email">
17+
<ElInput v-model="form.email" placeholder="Your email" required />
18+
</ElFormItem>
19+
<ElButton type="primary" @click="submitForm('mailgunForm')">
20+
💌 Send form
21+
</ElButton>
22+
<ElButton type="info" @click="resetForm('mailgunForm')">Reset</ElButton>
23+
<p>Response: {{ response }}</p>
24+
<p v-if="error" style="color: red">
25+
<strong>Error {{ error.status }}</strong>
26+
<br />
27+
{{ error.data }}
28+
</p>
29+
</ElForm>
30+
</template>
31+
132
<script>
233
export default {
334
name: 'Example6',
@@ -63,34 +94,3 @@ export default {
6394
},
6495
}
6596
</script>
66-
67-
<template>
68-
<ElForm
69-
ref="mailgunForm"
70-
:rules="rules"
71-
:model="form"
72-
label-width="80px"
73-
label-position="left"
74-
>
75-
<h2>
76-
6. Send form submission with
77-
<a href="https://www.mailgun.com/" target="_blank">Mailgun</a>
78-
</h2>
79-
<ElFormItem label="Name" prop="name">
80-
<ElInput v-model="form.name" placeholder="Your name" required />
81-
</ElFormItem>
82-
<ElFormItem label="Email" prop="email">
83-
<ElInput v-model="form.email" placeholder="Your email" required />
84-
</ElFormItem>
85-
<ElButton type="primary" @click="submitForm('mailgunForm')">
86-
💌 Send form
87-
</ElButton>
88-
<ElButton type="info" @click="resetForm('mailgunForm')">Reset</ElButton>
89-
<p>Response: {{ response }}</p>
90-
<p v-if="error" style="color: red">
91-
<strong>Error {{ error.status }}</strong>
92-
<br />
93-
{{ error.data }}
94-
</p>
95-
</ElForm>
96-
</template>

0 commit comments

Comments
 (0)