Skip to content

Commit

Permalink
Adds pinia and vue router
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronzi committed Aug 8, 2024
1 parent c26cb98 commit 23c7f93
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 2 deletions.
2 changes: 2 additions & 0 deletions frontend/aashub/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
HelloWorld: typeof import('./src/components/HelloWorld.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
}
2 changes: 2 additions & 0 deletions frontend/aashub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"eslint": "^9.8.0",
"eslint-plugin-oxlint": "^0.5.0",
"eslint-plugin-vue": "^9.27.0",
"pinia": "^2.2.1",
"globals": "^15.9.0",
"prettier": "^3.3.3",
"sass": "1.77.8",
Expand All @@ -34,6 +35,7 @@
"vite": "^5.3.3",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-vuetify": "^2.0.3",
"vue-router": "^4.2.0",
"vue-tsc": "^2.0.26"
}
}
2 changes: 1 addition & 1 deletion frontend/aashub/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<v-app>
<v-main>
<HelloWorld />
<router-view />
</v-main>
</v-app>
</template>
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion frontend/aashub/src/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@

// Plugins
import vuetify from './vuetify';
import router from '../router';
import pinia from '../stores';

// Types
import type { App } from 'vue';

export function registerPlugins(app: App) {
app.use(vuetify);
app.use(vuetify).use(router).use(pinia);
}
20 changes: 20 additions & 0 deletions frontend/aashub/src/router/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* router/index.ts
*
* Automatic routes for `./src/pages/*.vue`
*/

// Composables
import { createRouter, createWebHistory } from 'vue-router';

// Views
import HelloWorld from '@/pages/HelloWorld.vue';

const routes = [{ path: '/', component: HelloWorld }];

const router = createRouter({
history: createWebHistory(),
routes,
});

export default router;
10 changes: 10 additions & 0 deletions frontend/aashub/src/stores/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Utilities
import { defineStore } from 'pinia';

export const useAppStore = defineStore('app', {
state: () => ({
//
}),
getters: {},
actions: {},
});
4 changes: 4 additions & 0 deletions frontend/aashub/src/stores/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Utilities
import { createPinia } from 'pinia';

export default createPinia();
25 changes: 25 additions & 0 deletions frontend/aashub/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,11 @@
de-indent "^1.0.2"
he "^1.2.0"

"@vue/devtools-api@^6.6.3":
version "6.6.3"
resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.6.3.tgz#b23a588154cba8986bba82b6e1d0248bde3fd1a0"
integrity sha512-0MiMsFma/HqA6g3KLKn+AGpL1kgKhFWszC9U29NfpWK5LE7bjeXxySWJrOJ77hBz+TBrBQ7o4QJqbPbqbs8rJw==

"@vue/eslint-config-prettier@^9.0.0":
version "9.0.0"
resolved "https://registry.yarnpkg.com/@vue/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz#f63394f8f7759d92b6ef3f3e1d30ff6b0c0b97c1"
Expand Down Expand Up @@ -1365,6 +1370,14 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.3.1:
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==

pinia@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/pinia/-/pinia-2.2.1.tgz#7cf860f6a23981c23e58605cee45496ce46d15d1"
integrity sha512-ltEU3xwiz5ojVMizdP93AHi84Rtfz0+yKd8ud75hr9LVyWX2alxp7vLbY1kFm7MXFmHHr/9B08Xf8Jj6IHTEiQ==
dependencies:
"@vue/devtools-api" "^6.6.3"
vue-demi "^0.14.10"

pkg-types@^1.0.3, pkg-types@^1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-1.1.3.tgz#161bb1242b21daf7795036803f28e30222e476e3"
Expand Down Expand Up @@ -1686,6 +1699,11 @@ vscode-uri@^3.0.8:
resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f"
integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==

vue-demi@^0.14.10:
version "0.14.10"
resolved "https://registry.yarnpkg.com/vue-demi/-/vue-demi-0.14.10.tgz#afc78de3d6f9e11bf78c55e8510ee12814522f04"
integrity sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==

vue-eslint-parser@^9.3.1, vue-eslint-parser@^9.4.3:
version "9.4.3"
resolved "https://registry.yarnpkg.com/vue-eslint-parser/-/vue-eslint-parser-9.4.3.tgz#9b04b22c71401f1e8bca9be7c3e3416a4bde76a8"
Expand All @@ -1699,6 +1717,13 @@ vue-eslint-parser@^9.3.1, vue-eslint-parser@^9.4.3:
lodash "^4.17.21"
semver "^7.3.6"

vue-router@^4.2.0:
version "4.4.3"
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.4.3.tgz#58a39dc804632bfb6d26f052aa8f6718bd130299"
integrity sha512-sv6wmNKx2j3aqJQDMxLFzs/u/mjA9Z5LCgy6BE0f7yFWMjrPLnS/sPNn8ARY/FXw6byV18EFutn5lTO6+UsV5A==
dependencies:
"@vue/devtools-api" "^6.6.3"

vue-tsc@^2.0.26:
version "2.0.29"
resolved "https://registry.yarnpkg.com/vue-tsc/-/vue-tsc-2.0.29.tgz#bf7e9605af9fadec7fd6037d242217f5c6ad2c3b"
Expand Down

0 comments on commit 23c7f93

Please sign in to comment.