create-v-kit-spa 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/commands.d.ts +1 -1
- package/dist/commands.js +78 -67
- package/dist/count.d.ts +2 -2
- package/dist/count.d.ts.map +1 -1
- package/dist/count.js +45 -44
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/messages.d.ts +2 -2
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +70 -69
- package/dist/progress.d.ts +1 -1
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +38 -37
- package/dist/prompts.d.ts +4 -3
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +80 -77
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +33 -33
- package/dist/version.d.ts +1 -1
- package/dist/version.js +20 -20
- package/lib/162/.env.example +1 -7
- package/lib/162/README.md +0 -19
- package/lib/162/app/Http/Controllers/MainController.php +12 -0
- package/lib/162/composer.json +3 -7
- package/lib/162/composer.lock +579 -1140
- package/lib/162/config/cache.php +4 -3
- package/lib/162/config/database.php +5 -2
- package/lib/162/config/filesystems.php +3 -2
- package/lib/162/config/logging.php +1 -1
- package/lib/162/config/mail.php +15 -2
- package/lib/162/config/queue.php +4 -4
- package/lib/162/config/services.php +4 -0
- package/lib/162/config/session.php +0 -1
- package/lib/162/package.json +1 -9
- package/lib/162/public/.htaccess +6 -8
- package/lib/162/resources/js/app.js +10 -10
- package/lib/162/resources/js/components/About.vue +4 -4
- package/lib/162/resources/js/components/Home.vue +11 -11
- package/lib/162/resources/js/components/pages/About.vue +5 -0
- package/lib/162/resources/js/components/pages/Error.vue +5 -0
- package/lib/162/resources/js/components/pages/Home.vue +21 -0
- package/lib/162/resources/js/components/templates/App.vue +86 -0
- package/lib/162/resources/js/failOver.js +8 -8
- package/lib/162/resources/js/mainStore.js +20 -0
- package/lib/162/resources/js/router.js +40 -24
- package/lib/162/resources/js/store.js +18 -18
- package/lib/162/resources/js/templates/App.vue +65 -65
- package/lib/162/resources/js/views/HomeView.vue +7 -7
- package/lib/162/resources/views/layouts/app.blade.php +13 -14
- package/lib/162/resources/views/welcome.blade.php +2 -2
- package/lib/162/routes/web.php +2 -3
- package/lib/162/vite.config.js +1 -1
- package/package.json +1 -1
- package/lib/162/package-lock.json +0 -1330
package/lib/162/config/cache.php
CHANGED
|
@@ -26,7 +26,7 @@ return [
|
|
|
26
26
|
| well as their drivers. You may even define multiple stores for the
|
|
27
27
|
| same cache driver to group types of items stored in your caches.
|
|
28
28
|
|
|
|
29
|
-
| Supported drivers: "
|
|
29
|
+
| Supported drivers: "array", "database", "file", "memcached",
|
|
30
30
|
| "redis", "dynamodb", "octane", "null"
|
|
31
31
|
|
|
|
32
32
|
*/
|
|
@@ -40,9 +40,10 @@ return [
|
|
|
40
40
|
|
|
41
41
|
'database' => [
|
|
42
42
|
'driver' => 'database',
|
|
43
|
+
'connection' => env('DB_CACHE_CONNECTION'),
|
|
43
44
|
'table' => env('DB_CACHE_TABLE', 'cache'),
|
|
44
|
-
'
|
|
45
|
-
'
|
|
45
|
+
'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'),
|
|
46
|
+
'lock_table' => env('DB_CACHE_LOCK_TABLE'),
|
|
46
47
|
],
|
|
47
48
|
|
|
48
49
|
'file' => [
|
|
@@ -37,6 +37,9 @@ return [
|
|
|
37
37
|
'database' => env('DB_DATABASE', database_path('database.sqlite')),
|
|
38
38
|
'prefix' => '',
|
|
39
39
|
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
|
|
40
|
+
'busy_timeout' => null,
|
|
41
|
+
'journal_mode' => null,
|
|
42
|
+
'synchronous' => null,
|
|
40
43
|
],
|
|
41
44
|
|
|
42
45
|
'mysql' => [
|
|
@@ -49,7 +52,7 @@ return [
|
|
|
49
52
|
'password' => env('DB_PASSWORD', ''),
|
|
50
53
|
'unix_socket' => env('DB_SOCKET', ''),
|
|
51
54
|
'charset' => env('DB_CHARSET', 'utf8mb4'),
|
|
52
|
-
'collation' => env('DB_COLLATION', '
|
|
55
|
+
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
|
|
53
56
|
'prefix' => '',
|
|
54
57
|
'prefix_indexes' => true,
|
|
55
58
|
'strict' => true,
|
|
@@ -69,7 +72,7 @@ return [
|
|
|
69
72
|
'password' => env('DB_PASSWORD', ''),
|
|
70
73
|
'unix_socket' => env('DB_SOCKET', ''),
|
|
71
74
|
'charset' => env('DB_CHARSET', 'utf8mb4'),
|
|
72
|
-
'collation' => env('DB_COLLATION', '
|
|
75
|
+
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
|
|
73
76
|
'prefix' => '',
|
|
74
77
|
'prefix_indexes' => true,
|
|
75
78
|
'strict' => true,
|
|
@@ -24,7 +24,7 @@ return [
|
|
|
24
24
|
| may even configure multiple disks for the same driver. Examples for
|
|
25
25
|
| most supported storage drivers are configured here for reference.
|
|
26
26
|
|
|
|
27
|
-
| Supported
|
|
27
|
+
| Supported drivers: "local", "ftp", "sftp", "s3"
|
|
28
28
|
|
|
|
29
29
|
*/
|
|
30
30
|
|
|
@@ -32,7 +32,8 @@ return [
|
|
|
32
32
|
|
|
33
33
|
'local' => [
|
|
34
34
|
'driver' => 'local',
|
|
35
|
-
'root' => storage_path('app'),
|
|
35
|
+
'root' => storage_path('app/private'),
|
|
36
|
+
'serve' => true,
|
|
36
37
|
'throw' => false,
|
|
37
38
|
],
|
|
38
39
|
|
|
@@ -45,7 +45,7 @@ return [
|
|
|
45
45
|
| utilizes the Monolog PHP logging library, which includes a variety
|
|
46
46
|
| of powerful log handlers and formatters that you're free to use.
|
|
47
47
|
|
|
|
48
|
-
| Available
|
|
48
|
+
| Available drivers: "single", "daily", "slack", "syslog",
|
|
49
49
|
| "errorlog", "monolog", "custom", "stack"
|
|
50
50
|
|
|
|
51
51
|
*/
|
package/lib/162/config/mail.php
CHANGED
|
@@ -30,7 +30,8 @@ return [
|
|
|
30
30
|
| your mailers below. You may also add additional mailers if needed.
|
|
31
31
|
|
|
|
32
32
|
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
|
|
33
|
-
| "postmark", "
|
|
33
|
+
| "postmark", "resend", "log", "array",
|
|
34
|
+
| "failover", "roundrobin"
|
|
34
35
|
|
|
|
35
36
|
*/
|
|
36
37
|
|
|
@@ -45,7 +46,7 @@ return [
|
|
|
45
46
|
'username' => env('MAIL_USERNAME'),
|
|
46
47
|
'password' => env('MAIL_PASSWORD'),
|
|
47
48
|
'timeout' => null,
|
|
48
|
-
'local_domain' => env('MAIL_EHLO_DOMAIN'),
|
|
49
|
+
'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
|
|
49
50
|
],
|
|
50
51
|
|
|
51
52
|
'ses' => [
|
|
@@ -60,6 +61,10 @@ return [
|
|
|
60
61
|
// ],
|
|
61
62
|
],
|
|
62
63
|
|
|
64
|
+
'resend' => [
|
|
65
|
+
'transport' => 'resend',
|
|
66
|
+
],
|
|
67
|
+
|
|
63
68
|
'sendmail' => [
|
|
64
69
|
'transport' => 'sendmail',
|
|
65
70
|
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
|
|
@@ -82,6 +87,14 @@ return [
|
|
|
82
87
|
],
|
|
83
88
|
],
|
|
84
89
|
|
|
90
|
+
'roundrobin' => [
|
|
91
|
+
'transport' => 'roundrobin',
|
|
92
|
+
'mailers' => [
|
|
93
|
+
'ses',
|
|
94
|
+
'postmark',
|
|
95
|
+
],
|
|
96
|
+
],
|
|
97
|
+
|
|
85
98
|
],
|
|
86
99
|
|
|
87
100
|
/*
|
package/lib/162/config/queue.php
CHANGED
|
@@ -36,10 +36,10 @@ return [
|
|
|
36
36
|
|
|
37
37
|
'database' => [
|
|
38
38
|
'driver' => 'database',
|
|
39
|
-
'connection' => env('DB_QUEUE_CONNECTION'
|
|
39
|
+
'connection' => env('DB_QUEUE_CONNECTION'),
|
|
40
40
|
'table' => env('DB_QUEUE_TABLE', 'jobs'),
|
|
41
41
|
'queue' => env('DB_QUEUE', 'default'),
|
|
42
|
-
'retry_after' => env('DB_QUEUE_RETRY_AFTER', 90),
|
|
42
|
+
'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90),
|
|
43
43
|
'after_commit' => false,
|
|
44
44
|
],
|
|
45
45
|
|
|
@@ -47,7 +47,7 @@ return [
|
|
|
47
47
|
'driver' => 'beanstalkd',
|
|
48
48
|
'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'),
|
|
49
49
|
'queue' => env('BEANSTALKD_QUEUE', 'default'),
|
|
50
|
-
'retry_after' => env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
|
|
50
|
+
'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90),
|
|
51
51
|
'block_for' => 0,
|
|
52
52
|
'after_commit' => false,
|
|
53
53
|
],
|
|
@@ -67,7 +67,7 @@ return [
|
|
|
67
67
|
'driver' => 'redis',
|
|
68
68
|
'connection' => env('REDIS_QUEUE_CONNECTION', 'default'),
|
|
69
69
|
'queue' => env('REDIS_QUEUE', 'default'),
|
|
70
|
-
'retry_after' => env('REDIS_QUEUE_RETRY_AFTER', 90),
|
|
70
|
+
'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90),
|
|
71
71
|
'block_for' => null,
|
|
72
72
|
'after_commit' => false,
|
|
73
73
|
],
|
package/lib/162/package.json
CHANGED
|
@@ -6,16 +6,8 @@
|
|
|
6
6
|
"build": "vite build"
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
|
-
"
|
|
10
|
-
"axios": "^1.6.4",
|
|
9
|
+
"axios": "^1.7.4",
|
|
11
10
|
"laravel-vite-plugin": "^1.0",
|
|
12
11
|
"vite": "^5.0"
|
|
13
|
-
},
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"@vitejs/plugin-vue": "^5.2.1",
|
|
16
|
-
"pinia": "^2.3.0",
|
|
17
|
-
"vue": "^3.5.13",
|
|
18
|
-
"vue-router": "^4.5.0",
|
|
19
|
-
"vuetify": "^3.7.5"
|
|
20
12
|
}
|
|
21
13
|
}
|
package/lib/162/public/.htaccess
CHANGED
|
@@ -2,22 +2,20 @@
|
|
|
2
2
|
<IfModule mod_negotiation.c>
|
|
3
3
|
Options -MultiViews -Indexes
|
|
4
4
|
</IfModule>
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
RewriteEngine On
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
|
|
9
8
|
# Handle Authorization Header
|
|
10
9
|
RewriteCond %{HTTP:Authorization} .
|
|
11
10
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
|
12
|
-
|
|
11
|
+
|
|
13
12
|
# Redirect Trailing Slashes If Not A Folder...
|
|
14
13
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
15
14
|
RewriteCond %{REQUEST_URI} (.+)/$
|
|
16
15
|
RewriteRule ^ %1 [L,R=301]
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# Handle Front Controller...
|
|
16
|
+
|
|
17
|
+
# Send Requests To Front Controller...
|
|
20
18
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
21
19
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
22
20
|
RewriteRule ^ index.php [L]
|
|
23
|
-
</IfModule>
|
|
21
|
+
</IfModule>
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import './bootstrap';
|
|
1
|
+
import './bootstrap.js';
|
|
2
2
|
import { createApp } from 'vue'
|
|
3
|
-
import App from './templates/App.vue'
|
|
3
|
+
import App from './components/templates/App.vue'
|
|
4
4
|
|
|
5
|
-
import router
|
|
6
|
-
|
|
7
|
-
import { createPinia } from 'pinia'
|
|
8
|
-
const pinia = createPinia()
|
|
5
|
+
import router from './router.js'
|
|
9
6
|
|
|
10
7
|
import 'vuetify/styles'
|
|
11
|
-
import { createVuetify } from 'vuetify'
|
|
8
|
+
import { createVuetify } from 'vuetify'
|
|
12
9
|
import * as components from 'vuetify/components'
|
|
13
10
|
import * as directives from 'vuetify/directives'
|
|
14
11
|
|
|
15
12
|
import '@mdi/font/css/materialdesignicons.css'
|
|
16
13
|
|
|
14
|
+
import { createPinia } from 'pinia'
|
|
15
|
+
|
|
16
|
+
const pinia = createPinia()
|
|
17
17
|
const vuetify = createVuetify({
|
|
18
18
|
components,
|
|
19
19
|
directives,
|
|
20
20
|
icons: {
|
|
21
|
-
defaultSet: 'mdi'
|
|
22
|
-
}
|
|
21
|
+
defaultSet: 'mdi',
|
|
22
|
+
},
|
|
23
23
|
})
|
|
24
24
|
|
|
25
25
|
const app = createApp(App)
|
|
26
|
-
app.use(router)
|
|
27
26
|
app.use(pinia)
|
|
28
27
|
app.use(vuetify)
|
|
28
|
+
app.use(router)
|
|
29
29
|
app.mount('#app')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<script setup></script>
|
|
2
|
-
|
|
3
|
-
<template>
|
|
4
|
-
About
|
|
1
|
+
<script setup></script>
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
About
|
|
5
5
|
</template>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { piniaStore } from '../store.js';
|
|
3
|
-
const store = piniaStore();
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<template>
|
|
7
|
-
<h1>HOME</h1>
|
|
8
|
-
<h1>{{ store.greet }}</h1>
|
|
9
|
-
<h1>Original : {{ store.count }}</h1>
|
|
10
|
-
<h1>Getter : {{ store.doubleCount }}</h1>
|
|
11
|
-
<v-btn @click="store.increment">Add</v-btn>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { piniaStore } from '../store.js';
|
|
3
|
+
const store = piniaStore();
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<h1>HOME</h1>
|
|
8
|
+
<h1>{{ store.greet }}</h1>
|
|
9
|
+
<h1>Original : {{ store.count }}</h1>
|
|
10
|
+
<h1>Getter : {{ store.doubleCount }}</h1>
|
|
11
|
+
<v-btn @click="store.increment">Add</v-btn>
|
|
12
12
|
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<h1>HOME</h1>
|
|
3
|
+
<h1>{{ sampleStore.greet }}</h1>
|
|
4
|
+
<h1>Original : {{ sampleStore.count }}</h1>
|
|
5
|
+
<h1>Getter : {{ sampleStore.doubleCount }}</h1>
|
|
6
|
+
<v-btn @click="sampleStore.increment">Add</v-btn>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import { useSampleStore } from '../../mainStore.js';
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
setup() {
|
|
14
|
+
const sampleStore = useSampleStore();
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
sampleStore,
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-app>
|
|
3
|
+
<v-app-bar
|
|
4
|
+
density="compact"
|
|
5
|
+
color="primary"
|
|
6
|
+
prominent
|
|
7
|
+
>
|
|
8
|
+
<v-app-bar-nav-icon variant="text" @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
|
|
9
|
+
<v-toolbar-title>Vue 3 - Laravel 11 SPA</v-toolbar-title>
|
|
10
|
+
</v-app-bar>
|
|
11
|
+
|
|
12
|
+
<v-navigation-drawer
|
|
13
|
+
v-model="drawer"
|
|
14
|
+
temporary
|
|
15
|
+
>
|
|
16
|
+
|
|
17
|
+
<v-list density="compact" class="pt-0" >
|
|
18
|
+
<v-list-item
|
|
19
|
+
v-for="(item, i) in items"
|
|
20
|
+
:key="i"
|
|
21
|
+
:value="item"
|
|
22
|
+
color="primary"
|
|
23
|
+
@click="$router.push(item.to)"
|
|
24
|
+
>
|
|
25
|
+
<template v-slot:prepend>
|
|
26
|
+
<v-icon :icon="item.icon"></v-icon>
|
|
27
|
+
</template>
|
|
28
|
+
<v-list-item-title v-text="item.text"></v-list-item-title>
|
|
29
|
+
</v-list-item>
|
|
30
|
+
</v-list>
|
|
31
|
+
</v-navigation-drawer>
|
|
32
|
+
|
|
33
|
+
<v-main>
|
|
34
|
+
<router-view></router-view>
|
|
35
|
+
</v-main>
|
|
36
|
+
</v-app>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
import { ref } from 'vue';
|
|
41
|
+
|
|
42
|
+
export default {
|
|
43
|
+
setup() {
|
|
44
|
+
const drawer = ref(false);
|
|
45
|
+
|
|
46
|
+
const items = ref([
|
|
47
|
+
{
|
|
48
|
+
text: 'Home',
|
|
49
|
+
to: '/',
|
|
50
|
+
icon: 'mdi-home'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
text: 'About',
|
|
54
|
+
to: '/about',
|
|
55
|
+
icon:'mdi-information-outline'
|
|
56
|
+
},
|
|
57
|
+
]);
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
drawer,
|
|
61
|
+
items
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<!-- <script>
|
|
68
|
+
export default {
|
|
69
|
+
data: () => ({
|
|
70
|
+
drawer: false,
|
|
71
|
+
items: [
|
|
72
|
+
{
|
|
73
|
+
title: 'Home',
|
|
74
|
+
to: '/',
|
|
75
|
+
icon: 'mdi-home'
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
title: 'About',
|
|
79
|
+
to: 'about',
|
|
80
|
+
icon:'mdi-information-outline'
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
|
|
84
|
+
}),
|
|
85
|
+
}
|
|
86
|
+
</script> -->
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import router from './router';
|
|
2
|
-
const routerBase = router.options.base;
|
|
3
|
-
|
|
4
|
-
export const base = routerBase == undefined ? '/' : '/ProjectName/'; // to be automated
|
|
5
|
-
|
|
6
|
-
// usage
|
|
7
|
-
// note: mainly used for multiple routes like /products/items/2 since api read it as items/2
|
|
8
|
-
// import { base } from '@/path.js'
|
|
1
|
+
import router from './router';
|
|
2
|
+
const routerBase = router.options.base;
|
|
3
|
+
|
|
4
|
+
export const base = routerBase == undefined ? '/' : '/ProjectName/'; // to be automated
|
|
5
|
+
|
|
6
|
+
// usage
|
|
7
|
+
// note: mainly used for multiple routes like /products/items/2 since api read it as items/2
|
|
8
|
+
// import { base } from '@/path.js'
|
|
9
9
|
// const response = await axios.get(`${base}api/getJobs`)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineStore } from 'pinia'
|
|
2
|
+
|
|
3
|
+
export const useSampleStore = defineStore('counter', {
|
|
4
|
+
state: () => {
|
|
5
|
+
return {
|
|
6
|
+
count: 0,
|
|
7
|
+
greet: 'Ohayooooo!',
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
getters: {
|
|
12
|
+
doubleCount: (state) => state.count * 2,
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
actions: {
|
|
16
|
+
increment() {
|
|
17
|
+
this.count++
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
})
|
|
@@ -1,24 +1,40 @@
|
|
|
1
|
-
import { createRouter, createWebHistory } from
|
|
2
|
-
|
|
3
|
-
const Home = () => import('./
|
|
4
|
-
const About
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { createRouter, createWebHistory } from 'vue-router'
|
|
2
|
+
|
|
3
|
+
const Home = () => import('./components/pages/Home.vue');
|
|
4
|
+
const About= () => import('./components/pages/About.vue');
|
|
5
|
+
const ErrorPage = () => import('./components/pages/Error.vue');
|
|
6
|
+
// import Home from './components/pages/Home.vue';
|
|
7
|
+
// import About from './components/pages/About.vue';
|
|
8
|
+
// import ErrorPage from './components/pages/Error.vue';
|
|
9
|
+
|
|
10
|
+
const router = createRouter({
|
|
11
|
+
history: createWebHistory(import.meta.env.BASE_URL),
|
|
12
|
+
routes: [
|
|
13
|
+
{
|
|
14
|
+
path: '/',
|
|
15
|
+
component: Home,
|
|
16
|
+
name: 'Home',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
path: '/about',
|
|
20
|
+
component: About,
|
|
21
|
+
name: 'About',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
path: '/:catchAll(.*)',
|
|
25
|
+
component: ErrorPage,
|
|
26
|
+
name: 'Error'
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// router.beforeEach((to, from, next) => {
|
|
32
|
+
// if(to.path == '/'){
|
|
33
|
+
// next('/')
|
|
34
|
+
// }else{
|
|
35
|
+
// next()
|
|
36
|
+
// }
|
|
37
|
+
// })
|
|
38
|
+
|
|
39
|
+
export default router;
|
|
40
|
+
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineStore } from 'pinia'
|
|
2
|
-
|
|
3
|
-
export const piniaStore = defineStore('store', {
|
|
4
|
-
state: () => {
|
|
5
|
-
return {
|
|
6
|
-
count: 0,
|
|
7
|
-
greet: 'Ohayooooo!',
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
getters: {
|
|
12
|
-
doubleCount: (state) => state.count * 2,
|
|
13
|
-
},
|
|
14
|
-
actions: {
|
|
15
|
-
increment() {
|
|
16
|
-
this.count++
|
|
17
|
-
},
|
|
18
|
-
},
|
|
1
|
+
import { defineStore } from 'pinia'
|
|
2
|
+
|
|
3
|
+
export const piniaStore = defineStore('store', {
|
|
4
|
+
state: () => {
|
|
5
|
+
return {
|
|
6
|
+
count: 0,
|
|
7
|
+
greet: 'Ohayooooo!',
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
getters: {
|
|
12
|
+
doubleCount: (state) => state.count * 2,
|
|
13
|
+
},
|
|
14
|
+
actions: {
|
|
15
|
+
increment() {
|
|
16
|
+
this.count++
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
19
|
})
|