Explorar o código

refactor(ChristmasLights): Converted to Vue composition API

Owen Diffey %!s(int64=2) %!d(string=hai) anos
pai
achega
51d077941b
Modificáronse 1 ficheiros con 14 adicións e 20 borrados
  1. 14 20
      frontend/src/components/ChristmasLights.vue

+ 14 - 20
frontend/src/components/ChristmasLights.vue

@@ -1,3 +1,17 @@
+<script setup lang="ts">
+import { computed } from "vue";
+import { useStore } from "vuex";
+
+const store = useStore();
+
+defineProps({
+	small: { type: Boolean, default: false },
+	lights: { type: Number, default: 1 }
+});
+
+const loggedIn = computed(() => store.state.user.auth.loggedIn);
+</script>
+
 <template>
 	<div
 		:class="{
@@ -14,26 +28,6 @@
 	</div>
 </template>
 
-<script>
-import { mapState } from "vuex";
-
-export default {
-	props: {
-		small: { type: Boolean, default: false },
-		lights: { type: Number, default: 1 }
-	},
-	computed: {
-		...mapState({
-			loggedIn: state => state.user.auth.loggedIn
-		})
-	},
-
-	async mounted() {
-		this.christmas = await lofig.get("siteSettings.christmas");
-	}
-};
-</script>
-
 <style lang="less" scoped>
 .christmas-mode {
 	.christmas-lights {