質問編集履歴

2

app.jsを追加

2018/08/01 20:49

投稿

math346613
math346613

スコア24

test CHANGED
File without changes
test CHANGED
@@ -50,6 +50,8 @@
50
50
 
51
51
  Laravel 5.6.24
52
52
 
53
+ CentOS 6.8
54
+
53
55
 
54
56
 
55
57
  ###ソースコード例
@@ -191,3 +193,71 @@
191
193
  </html>
192
194
 
193
195
  ```
196
+
197
+
198
+
199
+ ```app.js
200
+
201
+
202
+
203
+ /**
204
+
205
+ * First we will load all of this project's JavaScript dependencies which
206
+
207
+ * includes Vue and other libraries. It is a great starting point when
208
+
209
+ * building robust, powerful web applications using Vue and Laravel.
210
+
211
+ */
212
+
213
+
214
+
215
+ require('./bootstrap');
216
+
217
+
218
+
219
+ window.Vue = require('vue');
220
+
221
+ import ElementUI from 'element-ui'
222
+
223
+ import 'element-ui/lib/theme-chalk/index.css'
224
+
225
+ import locale from 'element-ui/lib/locale/lang/ja'
226
+
227
+
228
+
229
+ Vue.use(ElementUI, { locale })
230
+
231
+
232
+
233
+ /**
234
+
235
+ * Next, we will create a fresh Vue application instance and attach it to
236
+
237
+ * the page. Then, you may begin adding components to this application
238
+
239
+ * or customize the JavaScript scaffolding to fit your unique needs.
240
+
241
+ */
242
+
243
+
244
+
245
+
246
+
247
+ const app = new Vue({
248
+
249
+ el: '#app',
250
+
251
+ });
252
+
253
+
254
+
255
+
256
+
257
+ ```
258
+
259
+
260
+
261
+ jsやjQueryでも同様の現象が起こりますが
262
+
263
+ これはそもそもWEBページで読み込み後にjsで描画するのならば起こる現象なのでしょうか?

1

ソースコード例の記入

2018/08/01 20:49

投稿

math346613
math346613

スコア24

test CHANGED
File without changes
test CHANGED
@@ -49,3 +49,145 @@
49
49
  npm 5.6.0
50
50
 
51
51
  Laravel 5.6.24
52
+
53
+
54
+
55
+ ###ソースコード例
56
+
57
+
58
+
59
+ ```html
60
+
61
+ <!DOCTYPE html>
62
+
63
+ <html>
64
+
65
+ <head>
66
+
67
+ <meta charset="UTF-8">
68
+
69
+ <title>Hello</title>
70
+
71
+ <meta name="csrf-token" content="{{ csrf_token() }}">
72
+
73
+ <link rel="stylesheet" href="{{ asset('css/app.css') }}"/>
74
+
75
+ <script type="text/javascript">
76
+
77
+ window.Laravel = window.Laravel || {};
78
+
79
+ window.Laravel.csrfToken = "{{csrf_token()}}";
80
+
81
+ </script>
82
+
83
+ </head>
84
+
85
+ <body>
86
+
87
+ <div id="app">
88
+
89
+ <nav class="navbar navbar-expand-md navbar-light bg-success navbar-laravel">
90
+
91
+ <div class="container">
92
+
93
+ <a class="navbar-brand text-white font-weight-bold" href="{{ url('/') }}">
94
+
95
+ {{ config('app.name', 'Laravel') }}
96
+
97
+ </a>
98
+
99
+ <button class="navbar-toggler" type="button" data-toggle="collapse"
100
+
101
+ data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
102
+
103
+ <span class="navbar-toggler-icon"></span>
104
+
105
+ </button>
106
+
107
+ <div class="collapse navbar-collapse" id="navbarSupportedContent">
108
+
109
+ <!-- Left Side Of Navbar -->
110
+
111
+ <ul class="navbar-nav mr-auto">
112
+
113
+ </ul>
114
+
115
+ <!-- Right Side Of Navbar -->
116
+
117
+ <ul class="navbar-nav ml-auto">
118
+
119
+ <!-- Authentication Links -->
120
+
121
+ @guest
122
+
123
+ <li><a class="nav-link text-white" href="{{ route('login') }}">{{ __('Login') }}</a></li>
124
+
125
+ <li><a class="nav-link text-white" href="{{ route('register') }}">{{ __('Register') }}</a></li>
126
+
127
+ @else
128
+
129
+ <li class="nav-item dropdown">
130
+
131
+ <a id="navbarDropdown" class="nav-link dropdown-toggle text-white" href="#"
132
+
133
+ role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
134
+
135
+ {{ Auth::user()->name }} <span class="caret"></span>
136
+
137
+ </a>
138
+
139
+
140
+
141
+ <div class="dropdown-menu" aria-labelledby="navbarDropdown">
142
+
143
+ <a class="dropdown-item text-success" href="{{ route('logout') }}"
144
+
145
+ onclick="event.preventDefault();document.getElementById('logout-form').submit();">
146
+
147
+ {{ __('Logout') }}
148
+
149
+ </a>
150
+
151
+ <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
152
+
153
+ @csrf
154
+
155
+ </form>
156
+
157
+ <a class="dropdown-item text-success" href="{{ url('/user/register') }}">
158
+
159
+ {{ __('詳細設定') }}
160
+
161
+ </a>
162
+
163
+ </div>
164
+
165
+ </li>
166
+
167
+ @endguest
168
+
169
+ </ul>
170
+
171
+ </div>
172
+
173
+ </div>
174
+
175
+ </nav>
176
+
177
+ <main class="my-5">
178
+
179
+ <el-tag>HogeHoge</el-tag>
180
+
181
+ </main>
182
+
183
+ </div>
184
+
185
+ @include('common.footer')
186
+
187
+ <script src="{{ asset('js/app.js') }}"></script>
188
+
189
+ </body>
190
+
191
+ </html>
192
+
193
+ ```