As for Vue.js, the js file is not loaded and it says {{message}}
as it is now.
The following error occurs on the console:
I would like to display Hello Vue, what should I do?
Failed to load resource: the server responded with a status of 404 (Not Found)
app/javascript/packs/main.js
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue'
}
})
app/views/tops/index.html.erb
<divid="app">
{{message}}
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js">/script>
<script src="../../javascript/packages/main.js"></script>
Vue.js Deployment Reference Articles
javascript ruby-on-rails vue.js
I was able to load it with the following description.
<%=javascript_pack_tag'main'%>
© 2024 OneMinuteCode. All rights reserved.