Skip to content

Commit 23bbe0b

Browse files
marczycheddyerburgh
authored andcommitted
style: Use 2-space indentation in test components (#140)
This updates the test components to use 2-space indentation as prescribed by the editorconfig settings. Fixes #135
1 parent d78a7e8 commit 23bbe0b

20 files changed

+248
-248
lines changed
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<template>
2-
<div>
3-
<span>
4-
<child-component />
5-
</span>
6-
</div>
2+
<div>
3+
<span>
4+
<child-component />
5+
</span>
6+
</div>
77
</template>
88

99
<script>
10-
import ChildComponent from './component.vue'
10+
import ChildComponent from './component.vue'
1111
12-
export default{
13-
name: 'component-with-child',
14-
components: {
15-
ChildComponent
16-
}
12+
export default{
13+
name: 'component-with-child',
14+
components: {
15+
ChildComponent
1716
}
17+
}
1818
</script>
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<template>
2-
<div>
3-
{{reversedMessage}}
4-
</div>
2+
<div>
3+
{{reversedMessage}}
4+
</div>
55
</template>
66

77
<script>
8-
export default{
9-
name: 'component-with-child',
10-
data: () => ({
11-
message: 'egassem'
12-
}),
13-
computed: {
14-
reversedMessage: function () {
15-
return this.message.split('').reverse().join('')
16-
}
8+
export default{
9+
name: 'component-with-child',
10+
data: () => ({
11+
message: 'egassem'
12+
}),
13+
computed: {
14+
reversedMessage: function () {
15+
return this.message.split('').reverse().join('')
1716
}
1817
}
18+
}
1919
</script>
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<template>
2-
<div :class="$style['color-red']"></div>
2+
<div :class="$style['color-red']"></div>
33
</template>
44

55
<style module>
6-
.color-red {
7-
color: red;
8-
}
6+
.color-red {
7+
color: red;
8+
}
99
</style>
1010

1111
<script>
12-
export default{
13-
name: 'component-with-css-modules'
14-
}
12+
export default{
13+
name: 'component-with-css-modules'
14+
}
1515
</script>
Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
<template>
2-
<div>
3-
<button class="click" @click="clickHandler" id="button" />
4-
<button class="left-click" @mousedown="mousedownHandler" />
5-
<div @click="toggleActive" v-bind:class="{ toggle: true, active: isActive }" />
6-
<input class="keydown" type="text" @keydown="keydownHandler" />
7-
<input class="keydown-enter" type="text" @keydown.enter="keydownHandler" />
8-
</div>
2+
<div>
3+
<button class="click" @click="clickHandler" id="button" />
4+
<button class="left-click" @mousedown="mousedownHandler" />
5+
<div @click="toggleActive" v-bind:class="{ toggle: true, active: isActive }" />
6+
<input class="keydown" type="text" @keydown="keydownHandler" />
7+
<input class="keydown-enter" type="text" @keydown.enter="keydownHandler" />
8+
</div>
99
</template>
1010

1111
<script>
12-
export default{
13-
name: 'component-with-event',
14-
props: {
15-
clickHandler: {
16-
type: Function,
17-
default: () => {}
18-
},
19-
keydownHandler: {
20-
type: Function,
21-
default: () => {}
22-
}
12+
export default{
13+
name: 'component-with-event',
14+
props: {
15+
clickHandler: {
16+
type: Function,
17+
default: () => {}
2318
},
24-
data () {
25-
return {
26-
isActive: false
19+
keydownHandler: {
20+
type: Function,
21+
default: () => {}
22+
}
23+
},
24+
data () {
25+
return {
26+
isActive: false
27+
}
28+
},
29+
methods: {
30+
mousedownHandler (event) {
31+
if (event.button === 0) {
32+
this.clickHandler()
33+
console.info(event.defaultPrevented)
2734
}
2835
},
29-
methods: {
30-
mousedownHandler (event) {
31-
if (event.button === 0) {
32-
this.clickHandler()
33-
console.info(event.defaultPrevented)
34-
}
35-
},
36-
toggleActive () {
37-
this.isActive = !this.isActive
38-
}
36+
toggleActive () {
37+
this.isActive = !this.isActive
3938
}
4039
}
40+
}
4141
</script>
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<template>
2-
<div>
3-
{{ fromMount }}
4-
</div>
2+
<div>
3+
{{ fromMount }}
4+
</div>
55
</template>
66

77
<script>
8-
export default {
9-
name: 'component-with-inject',
10-
inject: ['fromMount'],
11-
beforeCreate () {
12-
this.setInBeforeCreate = 'created'
13-
}
8+
export default {
9+
name: 'component-with-inject',
10+
inject: ['fromMount'],
11+
beforeCreate () {
12+
this.setInBeforeCreate = 'created'
1413
}
14+
}
1515
</script>
Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
<template>
2-
<div />
2+
<div />
33
</template>
44

55
<script>
6-
export default{
7-
name: 'component-with-lifecycle-hooks',
8-
beforeCreate () {
9-
console.info()
10-
},
11-
created () {
12-
console.info()
13-
},
14-
beforeMount () {
15-
console.info()
16-
},
17-
mounted () {
18-
console.info()
19-
},
20-
beforeUpdate () {
21-
console.info()
22-
},
23-
updated () {
24-
console.info()
25-
},
26-
beforeDestroy () {
27-
console.info()
28-
},
29-
destroyed () {
30-
console.info()
31-
},
32-
activated () {
33-
console.info()
34-
},
35-
deactivated () {
36-
console.info()
37-
}
6+
export default{
7+
name: 'component-with-lifecycle-hooks',
8+
beforeCreate () {
9+
console.info()
10+
},
11+
created () {
12+
console.info()
13+
},
14+
beforeMount () {
15+
console.info()
16+
},
17+
mounted () {
18+
console.info()
19+
},
20+
beforeUpdate () {
21+
console.info()
22+
},
23+
updated () {
24+
console.info()
25+
},
26+
beforeDestroy () {
27+
console.info()
28+
},
29+
destroyed () {
30+
console.info()
31+
},
32+
activated () {
33+
console.info()
34+
},
35+
deactivated () {
36+
console.info()
3837
}
38+
}
3939
</script>
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<template>
2-
<div />
2+
<div />
33
</template>
44

55
<script>
6-
export default{
7-
name: 'component-with-methods',
8-
methods: {
9-
someMethod () {
10-
console.log('some method')
11-
}
6+
export default{
7+
name: 'component-with-methods',
8+
methods: {
9+
someMethod () {
10+
console.log('some method')
1211
}
1312
}
13+
}
1414
</script>
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<template>
2-
<div />
2+
<div />
33
</template>
44

55
<script>
6-
import testMixin from '../testMixin'
6+
import testMixin from '../testMixin'
77
8-
export default {
9-
name: 'component-with-mixin',
10-
mixins: [testMixin],
11-
created () {
12-
this.someMethod()
13-
},
14-
methods: {
15-
someMethod () {
16-
console.log('testMethod') // eslint-disable-line no-console
17-
}
8+
export default {
9+
name: 'component-with-mixin',
10+
mixins: [testMixin],
11+
created () {
12+
this.someMethod()
13+
},
14+
methods: {
15+
someMethod () {
16+
console.log('testMethod') // eslint-disable-line no-console
1817
}
1918
}
19+
}
2020
</script>
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<template>
2-
<div>
3-
<span>
4-
<child-component />
5-
<component-with-lifecycle-hooks />
6-
</span>
7-
</div>
2+
<div>
3+
<span>
4+
<child-component />
5+
<component-with-lifecycle-hooks />
6+
</span>
7+
</div>
88
</template>
99

1010
<script>
11-
import ComponentWithChild from './component-with-child.vue'
12-
import ComponentWithLifecycleHooks from './component-with-lifecycle-hooks.vue'
11+
import ComponentWithChild from './component-with-child.vue'
12+
import ComponentWithLifecycleHooks from './component-with-lifecycle-hooks.vue'
1313
14-
export default{
15-
name: 'component-with-nested-children',
16-
components: {
17-
ChildComponent: ComponentWithChild,
18-
ComponentWithLifecycleHooks
19-
}
14+
export default{
15+
name: 'component-with-nested-children',
16+
components: {
17+
ChildComponent: ComponentWithChild,
18+
ComponentWithLifecycleHooks
2019
}
20+
}
2121
</script>
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<template>
2-
<div>
3-
<p class="prop-1">{{prop1}}</p>
4-
<p class="prop-2">{{prop2}}</p>
5-
</div>
2+
<div>
3+
<p class="prop-1">{{prop1}}</p>
4+
<p class="prop-2">{{prop2}}</p>
5+
</div>
66
</template>
77

88
<script>
9-
export default{
10-
name: 'component-with-props',
11-
props: ['prop1', 'prop2']
12-
}
9+
export default{
10+
name: 'component-with-props',
11+
props: ['prop1', 'prop2']
12+
}
1313
</script>

0 commit comments

Comments
 (0)