Answer the question
In order to leave comments, you need to log in
Why are parameters not being passed to the vue component?
main.js
import Vue from 'vue'
import store from './store'
new Vue({
el: '#productList',
store,
template: '<span> msg: {{msg}}</span>',
props: ['msg']
})
<div id="productList" msg="сообщение"></div>
Answer the question
In order to leave comments, you need to log in
Because you are confusing the concepts of a component and an application. In your case, you need to do something like this:
main.js
import Vue from 'vue'
import store from './store'
Vue.component('productList', {
template: '<span> msg: {{msg}}</span>',
props: ['msg']
});
var app = new Vue({
el: '#app',
store,
})
<div id="app">
<product-list msg="message"></product-list>
</div>
Because in the example, it's not a component, but an application.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question