質問編集履歴
1
ソースコードを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
|
11
|
-
app
|
11
|
+
app.jsの中身
|
12
12
|
|
13
13
|
![イメージ説明](4963df1339ce19a0f4ef86982cd22798.png)
|
14
14
|
|
@@ -38,6 +38,202 @@
|
|
38
38
|
|
39
39
|
|
40
40
|
|
41
|
+
ソースコードです。
|
42
|
+
|
43
|
+
app.js
|
44
|
+
|
45
|
+
```javascript
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
/**
|
50
|
+
|
51
|
+
* First we will load all of this project's JavaScript dependencies which
|
52
|
+
|
53
|
+
* includes Vue and other libraries. It is a great starting point when
|
54
|
+
|
55
|
+
* building robust, powerful web applications using Vue and Laravel.
|
56
|
+
|
57
|
+
*/
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
require('./bootstrap');
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
window.Vue = require('vue');
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
/**
|
70
|
+
|
71
|
+
* The following block of code may be used to automatically register your
|
72
|
+
|
73
|
+
* Vue components. It will recursively scan this directory for the Vue
|
74
|
+
|
75
|
+
* components and automatically register them with their "basename".
|
76
|
+
|
77
|
+
*
|
78
|
+
|
79
|
+
* Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
|
80
|
+
|
81
|
+
*/
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
// const files = require.context('./', true, /.vue$/i)
|
86
|
+
|
87
|
+
// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
// Vue.component(
|
92
|
+
|
93
|
+
// 'example-component',
|
94
|
+
|
95
|
+
// require('./components/ExampleComponent.vue')
|
96
|
+
|
97
|
+
// );
|
98
|
+
|
99
|
+
Vue.component(
|
100
|
+
|
101
|
+
'articles',
|
102
|
+
|
103
|
+
require('./components/Articles.vue')
|
104
|
+
|
105
|
+
);
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
/**
|
110
|
+
|
111
|
+
* Next, we will create a fresh Vue application instance and attach it to
|
112
|
+
|
113
|
+
* the page. Then, you may begin adding components to this application
|
114
|
+
|
115
|
+
* or customize the JavaScript scaffolding to fit your unique needs.
|
116
|
+
|
117
|
+
*/
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
const app = new Vue({
|
122
|
+
|
123
|
+
el: '#app'
|
124
|
+
|
125
|
+
});
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
```
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
Articles.vue
|
134
|
+
|
135
|
+
```vue
|
136
|
+
|
137
|
+
<template>
|
138
|
+
|
139
|
+
<div>
|
140
|
+
|
141
|
+
<h2>Articles</h2>
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
</template>
|
146
|
+
|
147
|
+
```
|
148
|
+
|
149
|
+
web.php
|
150
|
+
|
151
|
+
```php
|
152
|
+
|
153
|
+
<?php
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
/*
|
158
|
+
|
159
|
+
|--------------------------------------------------------------------------
|
160
|
+
|
161
|
+
| Web Routes
|
162
|
+
|
163
|
+
|--------------------------------------------------------------------------
|
164
|
+
|
165
|
+
|
|
166
|
+
|
167
|
+
| Here is where you can register web routes for your application. These
|
168
|
+
|
169
|
+
| routes are loaded by the RouteServiceProvider within a group which
|
170
|
+
|
171
|
+
| contains the "web" middleware group. Now create something great!
|
172
|
+
|
173
|
+
|
|
174
|
+
|
175
|
+
*/
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
Route::get('/', function () {
|
180
|
+
|
181
|
+
return view('welcome');
|
182
|
+
|
183
|
+
});
|
184
|
+
|
185
|
+
```
|
186
|
+
|
187
|
+
welcome.blade.php
|
188
|
+
|
189
|
+
```php
|
190
|
+
|
191
|
+
<!doctype html>
|
192
|
+
|
193
|
+
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
194
|
+
|
195
|
+
<head>
|
196
|
+
|
197
|
+
<meta charset="utf-8">
|
198
|
+
|
199
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
<title>Larticles App</title>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
<!-- Fonts -->
|
208
|
+
|
209
|
+
<link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet" type="text/css">
|
210
|
+
|
211
|
+
</head>
|
212
|
+
|
213
|
+
<body>
|
214
|
+
|
215
|
+
<div id="app">
|
216
|
+
|
217
|
+
<div class="container">
|
218
|
+
|
219
|
+
<articles></articles>
|
220
|
+
|
221
|
+
</div>
|
222
|
+
|
223
|
+
</div>
|
224
|
+
|
225
|
+
<script src="{{ asset('js/app.js')}}"></script>
|
226
|
+
|
227
|
+
</body>
|
228
|
+
|
229
|
+
</html>
|
230
|
+
|
231
|
+
```
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
41
237
|
Laravelを使ったことのある方、またはVue.js phpに詳しい方がいましたら
|
42
238
|
|
43
239
|
ご確認いただけないでしょうか?
|