feat: vue project setup

This commit is contained in:
Pihkaal
2025-11-04 23:14:48 +01:00
parent da0346df42
commit 9800b42e5c
21 changed files with 4828 additions and 0 deletions

9
src/App.vue Normal file
View File

@@ -0,0 +1,9 @@
<script setup lang="ts">
import AppCounter from "@/components/AppCounter.vue";
console.log("Ok");
</script>
<template>
<AppCounter />
</template>

11
src/__tests__/App.spec.ts Normal file
View File

@@ -0,0 +1,11 @@
import { describe, it, expect } from "vitest";
import { mount } from "@vue/test-utils";
import App from "../App.vue";
describe("App", () => {
it("mounts renders properly", () => {
const wrapper = mount(App);
expect(wrapper.text()).toContain("You did it!");
});
});

View File

@@ -0,0 +1,9 @@
<script setup lang="ts">
import { useCounterStore } from "@/stores/counter";
const counter = useCounterStore();
</script>
<template>
<button @click="counter.increment">Count: {{ counter.count }}</button>
</template>

9
src/main.ts Normal file
View File

@@ -0,0 +1,9 @@
import { createApp } from "vue";
import { createPinia } from "pinia";
import App from "./App.vue";
const app = createApp(App);
app.use(createPinia());
app.mount("#app");

12
src/stores/counter.ts Normal file
View File

@@ -0,0 +1,12 @@
import { ref } from "vue";
import { defineStore } from "pinia";
export const useCounterStore = defineStore("counter", () => {
const count = ref(0);
const increment = () => {
count.value += 1;
};
return { count, increment };
});