0
VueインスタンスからVueコンポーネントにデータを渡すにはどうすればよいですか?私はここでfiddleVueインスタンスからVueコンポーネントにデータを渡す
HTML
<div id="app">
<my-notification></my-notification>
</div>
<template id="my-template">
<ul>
<li v-for="nn in notifications">{{ nn }}</li>
</ul>
</template>
のVueスクリプト
Vue.component('my-notification',{
template : '#my-template',
});
new Vue({
el : '#app',
data : {
notifications : ['notification 1','notification 2','notification 3']
}
});
が持っているもの残念ながらですが、私のコンポーネントテンプレート内に存在する '李' に 'V-のための' を実行しようとしています私はこれまでに試してみました(私のフィドルを参照してください)は動作していない、任意の助けてください? [vue.js内のコンポーネントにデータを渡す]の
可能な複製(http://stackoverflow.com/questions/34534151/passing-data-to-components-in- vue-js) –