create-v-kit-spa 0.9.6 → 0.9.9
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 +38 -9
- package/lib/159/Still Under Development Thank you.txt +0 -0
- package/lib/161/.editorconfig +18 -0
- package/lib/161/.env.example +58 -0
- package/lib/161/.gitattributes +11 -0
- package/lib/161/README.md +66 -0
- package/lib/161/app/Console/Kernel.php +27 -0
- package/lib/161/app/Exceptions/Handler.php +48 -0
- package/lib/161/app/Http/Controllers/Controller.php +12 -0
- package/lib/161/app/Http/Controllers/MainController.php +12 -0
- package/lib/161/app/Http/Kernel.php +67 -0
- package/lib/161/app/Http/Middleware/Authenticate.php +17 -0
- package/lib/161/app/Http/Middleware/EncryptCookies.php +17 -0
- package/lib/161/app/Http/Middleware/PreventRequestsDuringMaintenance.php +17 -0
- package/lib/161/app/Http/Middleware/RedirectIfAuthenticated.php +30 -0
- package/lib/161/app/Http/Middleware/TrimStrings.php +19 -0
- package/lib/161/app/Http/Middleware/TrustHosts.php +20 -0
- package/lib/161/app/Http/Middleware/TrustProxies.php +28 -0
- package/lib/161/app/Http/Middleware/ValidateSignature.php +22 -0
- package/lib/161/app/Http/Middleware/VerifyCsrfToken.php +17 -0
- package/lib/161/app/Models/User.php +44 -0
- package/lib/161/app/Providers/AppServiceProvider.php +24 -0
- package/lib/161/app/Providers/AuthServiceProvider.php +28 -0
- package/lib/161/app/Providers/BroadcastServiceProvider.php +19 -0
- package/lib/161/app/Providers/EventServiceProvider.php +38 -0
- package/lib/161/app/Providers/RouteServiceProvider.php +48 -0
- package/lib/161/artisan +53 -0
- package/lib/161/bootstrap/app.php +55 -0
- package/lib/161/bootstrap/cache/.gitignore +2 -0
- package/lib/161/composer.json +68 -0
- package/lib/161/composer.lock +8129 -0
- package/lib/161/config/app.php +215 -0
- package/lib/161/config/auth.php +115 -0
- package/lib/161/config/broadcasting.php +70 -0
- package/lib/161/config/cache.php +110 -0
- package/lib/161/config/cors.php +34 -0
- package/lib/161/config/database.php +151 -0
- package/lib/161/config/filesystems.php +76 -0
- package/lib/161/config/hashing.php +52 -0
- package/lib/161/config/logging.php +122 -0
- package/lib/161/config/mail.php +124 -0
- package/lib/161/config/queue.php +93 -0
- package/lib/161/config/sanctum.php +67 -0
- package/lib/161/config/services.php +34 -0
- package/lib/161/config/session.php +201 -0
- package/lib/161/config/view.php +36 -0
- package/lib/161/database/factories/UserFactory.php +40 -0
- package/lib/161/database/migrations/2014_10_12_000000_create_users_table.php +32 -0
- package/lib/161/database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php +28 -0
- package/lib/161/database/migrations/2019_08_19_000000_create_failed_jobs_table.php +32 -0
- package/lib/161/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php +33 -0
- package/lib/161/database/seeders/DatabaseSeeder.php +22 -0
- package/lib/161/package.json +22 -0
- package/lib/161/phpunit.xml +31 -0
- package/lib/161/public/.htaccess +21 -0
- package/lib/161/public/favicon.ico +0 -0
- package/lib/161/public/index.php +55 -0
- package/lib/161/public/robots.txt +2 -0
- package/lib/161/resources/css/app.css +0 -0
- package/lib/161/resources/js/app.js +29 -0
- package/lib/161/resources/js/bootstrap.js +32 -0
- package/lib/161/resources/js/components/pages/About.vue +5 -0
- package/lib/161/resources/js/components/pages/Error.vue +5 -0
- package/lib/161/resources/js/components/pages/Home.vue +21 -0
- package/lib/161/resources/js/components/templates/App.vue +86 -0
- package/lib/161/resources/js/mainStore.js +20 -0
- package/lib/161/resources/js/router.js +40 -0
- package/lib/161/resources/views/layouts/app.blade.php +14 -0
- package/lib/161/resources/views/welcome.blade.php +140 -0
- package/lib/161/routes/api.php +19 -0
- package/lib/161/routes/channels.php +18 -0
- package/lib/161/routes/console.php +19 -0
- package/lib/161/routes/web.php +20 -0
- package/lib/161/storage/framework/sessions/pZVIGWLA97WqxtDY2GXSj4Z0biGFAD4MwRDJU1P6 +1 -0
- package/lib/161/storage/framework/views/2e9971bec8a529e679b1529e9584647f.php +14 -0
- package/lib/161/tests/CreatesApplication.php +21 -0
- package/lib/161/tests/Feature/ExampleTest.php +19 -0
- package/lib/161/tests/TestCase.php +10 -0
- package/lib/161/tests/Unit/ExampleTest.php +16 -0
- package/lib/161/vite.config.js +10 -0
- package/lib/162/.editorconfig +18 -0
- package/lib/162/.env.example +64 -0
- package/lib/162/.gitattributes +11 -0
- package/lib/162/README.md +66 -0
- package/lib/162/app/Http/Controllers/Controller.php +8 -0
- package/lib/162/app/Http/Controllers/MainController.php +12 -0
- package/lib/162/app/Models/User.php +47 -0
- package/lib/162/app/Providers/AppServiceProvider.php +24 -0
- package/lib/162/artisan +15 -0
- package/lib/162/bootstrap/app.php +18 -0
- package/lib/162/bootstrap/cache/.gitignore +2 -0
- package/lib/162/bootstrap/providers.php +5 -0
- package/lib/162/composer.json +65 -0
- package/lib/162/composer.lock +7763 -0
- package/lib/162/config/app.php +126 -0
- package/lib/162/config/auth.php +115 -0
- package/lib/162/config/cache.php +108 -0
- package/lib/162/config/database.php +173 -0
- package/lib/162/config/filesystems.php +77 -0
- package/lib/162/config/logging.php +132 -0
- package/lib/162/config/mail.php +116 -0
- package/lib/162/config/queue.php +112 -0
- package/lib/162/config/services.php +38 -0
- package/lib/162/config/session.php +217 -0
- package/lib/162/database/database.sqlite +0 -0
- package/lib/162/database/factories/UserFactory.php +44 -0
- package/lib/162/database/migrations/0001_01_01_000000_create_users_table.php +49 -0
- package/lib/162/database/migrations/0001_01_01_000001_create_cache_table.php +35 -0
- package/lib/162/database/migrations/0001_01_01_000002_create_jobs_table.php +57 -0
- package/lib/162/database/seeders/DatabaseSeeder.php +23 -0
- package/lib/162/package.json +13 -0
- package/lib/162/phpunit.xml +33 -0
- package/lib/162/public/.htaccess +21 -0
- package/lib/162/public/favicon.ico +0 -0
- package/lib/162/public/index.php +17 -0
- package/lib/162/public/robots.txt +2 -0
- package/lib/162/resources/css/app.css +0 -0
- package/lib/162/resources/js/app.js +29 -0
- package/lib/162/resources/js/bootstrap.js +4 -0
- 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/mainStore.js +20 -0
- package/lib/162/resources/js/router.js +40 -0
- package/lib/162/resources/views/layouts/app.blade.php +14 -0
- package/lib/162/resources/views/welcome.blade.php +172 -0
- package/lib/162/routes/console.php +8 -0
- package/lib/162/routes/web.php +6 -0
- package/lib/162/tests/Feature/ExampleTest.php +19 -0
- package/lib/162/tests/TestCase.php +10 -0
- package/lib/162/tests/Unit/ExampleTest.php +16 -0
- package/lib/162/vite.config.js +13 -0
- package/package.json +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Run the migrations.
|
|
11
|
+
*/
|
|
12
|
+
public function up(): void
|
|
13
|
+
{
|
|
14
|
+
Schema::create('users', function (Blueprint $table) {
|
|
15
|
+
$table->id();
|
|
16
|
+
$table->string('name');
|
|
17
|
+
$table->string('email')->unique();
|
|
18
|
+
$table->timestamp('email_verified_at')->nullable();
|
|
19
|
+
$table->string('password');
|
|
20
|
+
$table->rememberToken();
|
|
21
|
+
$table->timestamps();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
|
25
|
+
$table->string('email')->primary();
|
|
26
|
+
$table->string('token');
|
|
27
|
+
$table->timestamp('created_at')->nullable();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
Schema::create('sessions', function (Blueprint $table) {
|
|
31
|
+
$table->string('id')->primary();
|
|
32
|
+
$table->foreignId('user_id')->nullable()->index();
|
|
33
|
+
$table->string('ip_address', 45)->nullable();
|
|
34
|
+
$table->text('user_agent')->nullable();
|
|
35
|
+
$table->longText('payload');
|
|
36
|
+
$table->integer('last_activity')->index();
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Reverse the migrations.
|
|
42
|
+
*/
|
|
43
|
+
public function down(): void
|
|
44
|
+
{
|
|
45
|
+
Schema::dropIfExists('users');
|
|
46
|
+
Schema::dropIfExists('password_reset_tokens');
|
|
47
|
+
Schema::dropIfExists('sessions');
|
|
48
|
+
}
|
|
49
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Run the migrations.
|
|
11
|
+
*/
|
|
12
|
+
public function up(): void
|
|
13
|
+
{
|
|
14
|
+
Schema::create('cache', function (Blueprint $table) {
|
|
15
|
+
$table->string('key')->primary();
|
|
16
|
+
$table->mediumText('value');
|
|
17
|
+
$table->integer('expiration');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
Schema::create('cache_locks', function (Blueprint $table) {
|
|
21
|
+
$table->string('key')->primary();
|
|
22
|
+
$table->string('owner');
|
|
23
|
+
$table->integer('expiration');
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Reverse the migrations.
|
|
29
|
+
*/
|
|
30
|
+
public function down(): void
|
|
31
|
+
{
|
|
32
|
+
Schema::dropIfExists('cache');
|
|
33
|
+
Schema::dropIfExists('cache_locks');
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Database\Schema\Blueprint;
|
|
5
|
+
use Illuminate\Support\Facades\Schema;
|
|
6
|
+
|
|
7
|
+
return new class extends Migration
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Run the migrations.
|
|
11
|
+
*/
|
|
12
|
+
public function up(): void
|
|
13
|
+
{
|
|
14
|
+
Schema::create('jobs', function (Blueprint $table) {
|
|
15
|
+
$table->id();
|
|
16
|
+
$table->string('queue')->index();
|
|
17
|
+
$table->longText('payload');
|
|
18
|
+
$table->unsignedTinyInteger('attempts');
|
|
19
|
+
$table->unsignedInteger('reserved_at')->nullable();
|
|
20
|
+
$table->unsignedInteger('available_at');
|
|
21
|
+
$table->unsignedInteger('created_at');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
Schema::create('job_batches', function (Blueprint $table) {
|
|
25
|
+
$table->string('id')->primary();
|
|
26
|
+
$table->string('name');
|
|
27
|
+
$table->integer('total_jobs');
|
|
28
|
+
$table->integer('pending_jobs');
|
|
29
|
+
$table->integer('failed_jobs');
|
|
30
|
+
$table->longText('failed_job_ids');
|
|
31
|
+
$table->mediumText('options')->nullable();
|
|
32
|
+
$table->integer('cancelled_at')->nullable();
|
|
33
|
+
$table->integer('created_at');
|
|
34
|
+
$table->integer('finished_at')->nullable();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
Schema::create('failed_jobs', function (Blueprint $table) {
|
|
38
|
+
$table->id();
|
|
39
|
+
$table->string('uuid')->unique();
|
|
40
|
+
$table->text('connection');
|
|
41
|
+
$table->text('queue');
|
|
42
|
+
$table->longText('payload');
|
|
43
|
+
$table->longText('exception');
|
|
44
|
+
$table->timestamp('failed_at')->useCurrent();
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Reverse the migrations.
|
|
50
|
+
*/
|
|
51
|
+
public function down(): void
|
|
52
|
+
{
|
|
53
|
+
Schema::dropIfExists('jobs');
|
|
54
|
+
Schema::dropIfExists('job_batches');
|
|
55
|
+
Schema::dropIfExists('failed_jobs');
|
|
56
|
+
}
|
|
57
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace Database\Seeders;
|
|
4
|
+
|
|
5
|
+
use App\Models\User;
|
|
6
|
+
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
7
|
+
use Illuminate\Database\Seeder;
|
|
8
|
+
|
|
9
|
+
class DatabaseSeeder extends Seeder
|
|
10
|
+
{
|
|
11
|
+
/**
|
|
12
|
+
* Seed the application's database.
|
|
13
|
+
*/
|
|
14
|
+
public function run(): void
|
|
15
|
+
{
|
|
16
|
+
// User::factory(10)->create();
|
|
17
|
+
|
|
18
|
+
User::factory()->create([
|
|
19
|
+
'name' => 'Test User',
|
|
20
|
+
'email' => 'test@example.com',
|
|
21
|
+
]);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
3
|
+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
|
4
|
+
bootstrap="vendor/autoload.php"
|
|
5
|
+
colors="true"
|
|
6
|
+
>
|
|
7
|
+
<testsuites>
|
|
8
|
+
<testsuite name="Unit">
|
|
9
|
+
<directory>tests/Unit</directory>
|
|
10
|
+
</testsuite>
|
|
11
|
+
<testsuite name="Feature">
|
|
12
|
+
<directory>tests/Feature</directory>
|
|
13
|
+
</testsuite>
|
|
14
|
+
</testsuites>
|
|
15
|
+
<source>
|
|
16
|
+
<include>
|
|
17
|
+
<directory>app</directory>
|
|
18
|
+
</include>
|
|
19
|
+
</source>
|
|
20
|
+
<php>
|
|
21
|
+
<env name="APP_ENV" value="testing"/>
|
|
22
|
+
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
|
|
23
|
+
<env name="BCRYPT_ROUNDS" value="4"/>
|
|
24
|
+
<env name="CACHE_STORE" value="array"/>
|
|
25
|
+
<!-- <env name="DB_CONNECTION" value="sqlite"/> -->
|
|
26
|
+
<!-- <env name="DB_DATABASE" value=":memory:"/> -->
|
|
27
|
+
<env name="MAIL_MAILER" value="array"/>
|
|
28
|
+
<env name="PULSE_ENABLED" value="false"/>
|
|
29
|
+
<env name="QUEUE_CONNECTION" value="sync"/>
|
|
30
|
+
<env name="SESSION_DRIVER" value="array"/>
|
|
31
|
+
<env name="TELESCOPE_ENABLED" value="false"/>
|
|
32
|
+
</php>
|
|
33
|
+
</phpunit>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<IfModule mod_rewrite.c>
|
|
2
|
+
<IfModule mod_negotiation.c>
|
|
3
|
+
Options -MultiViews -Indexes
|
|
4
|
+
</IfModule>
|
|
5
|
+
|
|
6
|
+
RewriteEngine On
|
|
7
|
+
|
|
8
|
+
# Handle Authorization Header
|
|
9
|
+
RewriteCond %{HTTP:Authorization} .
|
|
10
|
+
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
|
11
|
+
|
|
12
|
+
# Redirect Trailing Slashes If Not A Folder...
|
|
13
|
+
RewriteCond %{REQUEST_FILENAME} !-d
|
|
14
|
+
RewriteCond %{REQUEST_URI} (.+)/$
|
|
15
|
+
RewriteRule ^ %1 [L,R=301]
|
|
16
|
+
|
|
17
|
+
# Send Requests To Front Controller...
|
|
18
|
+
RewriteCond %{REQUEST_FILENAME} !-d
|
|
19
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
|
20
|
+
RewriteRule ^ index.php [L]
|
|
21
|
+
</IfModule>
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Http\Request;
|
|
4
|
+
|
|
5
|
+
define('LARAVEL_START', microtime(true));
|
|
6
|
+
|
|
7
|
+
// Determine if the application is in maintenance mode...
|
|
8
|
+
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
|
|
9
|
+
require $maintenance;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Register the Composer autoloader...
|
|
13
|
+
require __DIR__.'/../vendor/autoload.php';
|
|
14
|
+
|
|
15
|
+
// Bootstrap Laravel and handle the request...
|
|
16
|
+
(require_once __DIR__.'/../bootstrap/app.php')
|
|
17
|
+
->handleRequest(Request::capture());
|
|
File without changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import './bootstrap.js';
|
|
2
|
+
import { createApp } from 'vue'
|
|
3
|
+
import App from './components/templates/App.vue'
|
|
4
|
+
|
|
5
|
+
import router from './router.js'
|
|
6
|
+
|
|
7
|
+
import 'vuetify/styles'
|
|
8
|
+
import { createVuetify } from 'vuetify'
|
|
9
|
+
import * as components from 'vuetify/components'
|
|
10
|
+
import * as directives from 'vuetify/directives'
|
|
11
|
+
|
|
12
|
+
import '@mdi/font/css/materialdesignicons.css'
|
|
13
|
+
|
|
14
|
+
import { createPinia } from 'pinia'
|
|
15
|
+
|
|
16
|
+
const pinia = createPinia()
|
|
17
|
+
const vuetify = createVuetify({
|
|
18
|
+
components,
|
|
19
|
+
directives,
|
|
20
|
+
icons: {
|
|
21
|
+
defaultSet: 'mdi',
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const app = createApp(App)
|
|
26
|
+
app.use(pinia)
|
|
27
|
+
app.use(vuetify)
|
|
28
|
+
app.use(router)
|
|
29
|
+
app.mount('#app')
|
|
@@ -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> -->
|
|
@@ -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
|
+
})
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Vue 3 - Laravel 11 SPA</title>
|
|
7
|
+
|
|
8
|
+
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
|
9
|
+
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="app"></div>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|