Skip to content

Commit 2fa266f

Browse files
Extract Vue components into own SFCs
Signed-off-by: Christian Wolf <[email protected]>
1 parent b7c5ee0 commit 2fa266f

File tree

4 files changed

+37
-17
lines changed

4 files changed

+37
-17
lines changed

src/components/AppControls.vue renamed to src/components/AppControls/AppControls.vue

+2-16
Original file line numberDiff line numberDiff line change
@@ -166,22 +166,8 @@ import LoadingIcon from "icons/Loading.vue"
166166
import CheckmarkIcon from "icons/Check.vue"
167167
import PrinterIcon from "icons/Printer.vue"
168168
169-
const ModeIndicator = {
170-
props: ["title"],
171-
render(h) {
172-
return h("span", { class: "mode-indicator" }, this.title)
173-
},
174-
}
175-
176-
const Location = {
177-
props: ["title"],
178-
render(h) {
179-
// Wrapper is to enable vertical centering if only child
180-
return h("div", { class: "location-wrapper" }, [
181-
h("h2", { class: "location" }, this.title),
182-
])
183-
},
184-
}
169+
import Location from "./Location.vue"
170+
import ModeIndicator from "./ModeIndicator.vue"
185171
186172
export default {
187173
name: "AppControls",
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<template>
2+
<div class="location-wrapper">
3+
<h2 class="location">{{ title }}</h2>
4+
</div>
5+
</template>
6+
7+
<script>
8+
export default {
9+
// eslint-disable-next-line vue/multi-word-component-names
10+
name: "Location",
11+
props: {
12+
title: {
13+
type: String,
14+
default: "",
15+
},
16+
},
17+
}
18+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<template>
2+
<span class="mode-indicator">{{ title }}</span>
3+
</template>
4+
5+
<script>
6+
export default {
7+
// eslint-disable-next-line vue/multi-word-component-names
8+
name: "ModeIndicator",
9+
props: {
10+
title: {
11+
type: String,
12+
default: "",
13+
},
14+
},
15+
}
16+
</script>

src/components/AppMain.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<script>
1616
import AppContent from "@nextcloud/vue/dist/Components/AppContent"
1717
import Content from "@nextcloud/vue/dist/Components/Content"
18-
import AppControls from "./AppControls.vue"
18+
import AppControls from "cookbook/components/AppControls/AppControls.vue"
1919
import AppNavi from "./AppNavi.vue"
2020
2121
export default {

0 commit comments

Comments
 (0)