evcc-io/assets/js/views/Main.vue

40 lines
826 B
Vue

<template>
<Site
:notifications="notifications"
v-bind="state"
:forecast="uiForecast"
:selected-loadpoint-index="selectedLoadpointIndex"
/>
</template>
<script lang="ts">
import { defineComponent, type PropType } from "vue";
import Site from "../components/Site/Site.vue";
import store from "../store";
import type { Notification } from "@/types/evcc";
export default defineComponent({
name: "Main",
components: { Site },
props: {
notifications: Array as PropType<Notification[]>,
selectedLoadpointIndex: Number,
},
computed: {
state() {
return store.state;
},
uiForecast() {
return store.uiForecast.value;
},
},
head() {
const title = store.state.siteTitle;
if (title) {
return { title };
}
// no custom title
return { title: "evcc", titleTemplate: null };
},
});
</script>