Vueのドキュメントは、共有/グローバルデータを保持するために、コンストラクタの「データ」オプションを使用することを言及: https://vuejs.org/v2/guide/state-management.htmlvuex "store"と "data:store"はVue()コンストラクタで最も良いですか?
これは理にかなっています。
Vuexのドキュメントは、しかし、プロパティ名なしで、 "ストア" オブジェクトを渡します。 https://github.com/vuejs/vuex/blob/dev/examples/counter/app.js
new Vue({
el: '#app',
store,
render: h => h(Counter)
})
は
new Vue({
el: '#app',
data: store,
render: h => h(Counter)
})
させてはなりませんか?
他の例としては、としてそれを渡す "店舗:店舗" https://ypereirareis.github.io/blog/2017/04/25/vuejs-two-way-data-binding-state-management-vuex-strict-mode/
が、 "店は" 文書化プロパティではありません:あなたのVueのインスタンスにstore
を使用して https://vuejs.org/v2/api/
'store'はVueXのものです:https://vuex.vuejs.org/en/getting-started.html – Terry