Home>
I get a [Vue warn]: Cannot find element: app error in Vue.js
web framework is rails
Hopefully it will be displayed as Hello.
How to install Vue.js
Related filesindex.html
<p>{{message}}</p>
<script src = "https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<% = javascript_pack_tag'top_vue'%>
app/javascript/packs/top_vue.js
var app = new Vue ({{
el:'app',
data: {
message: "Hello"
}
})
error
[Vue warn]: Cannot find element: app
warn @ vue.js: 634
query @ vue.js: 5666
Vue. $Mount @ vue.js: 11882
Vue._init @ vue.js: 5012
Vue @ vue.js: 5078
./app/javascript/packs/top_vue.js @ top_vue.js: 1
__webpack_require__ @ bootstrap: 19
(anonymous) @ bootstrap: 83
(anonymous) @ bootstrap: 83
Consideration
<script src = "https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
Is there a cause?
<% #<script src = "https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.12/vue.js"></script>%>
I tried changing it to, but the same error statement occurred at 1 warring and it did not change
-
Answer # 1
Related articles
- ruby - [rails] the cart function cannot get the cart id associated with the user
- ruby - the error in rails g migration cannot be resolved
- ruby on rails 5 - actioncontroller :: invalidauthenticitytoken cannot be resolved
- ruby on rails - the image cannot be saved in s3 and cannot be displayed in the view aws :: sigv4 :: errors :: missingcredentials
- ruby on rails runtime error cannot be resolved
- ruby - heroku run rails db: cannot migrate
- ruby on rails - i cannot save a comment on the comment posting page
- ruby on rails - about matters that cannot be migrated
- ruby on rails - cannot pass id to destroy action of intermediate table
- ruby on rails - webpacker cannot be compiled
- ruby on rails 5 - couldn't find user with'id'= cannot be resolved
- ruby on rails - data cannot be saved in the intermediate table (parameters cannot be passed)
- ruby on rails 5 - rails cannot retrieve params data
- ruby on rails - you cannot change the keychain after downloading the pem file when creating an ec2 instance the matter that come
- ruby on rails - syntax error cannot be resolved
- ruby on rails - [rails 6 vuejs] 406 error in axiosget
- vuejs - [vue] unknown custom element: cannot be resolved [nuxtjs]
- ruby on rails - cannot save nested child model
- ruby on rails - [docker] rails s -b 0000 => cannot render console from 1722801!
Not
Isn't it? Add # to specify the id.