186
rated 0 times
[
188]
[
2]
/ answers: 1 / hits: 20685
/ 8 Years ago, fri, december 2, 2016, 12:00:00
I have a simple Vue instance and want to pass json from the backend to vue without HTTP request because it's always the same.
I've tried do this with props, but it doesn't work...
In DOM it's looks like <div id=my-component prices=[object Object]>
Vue debug tool show me image as an empty string, and in console undefined
<div id=my-component :prices={{ $prices }}>
</div>
<script>
new Vue({
el: '#my-component',
props: ['prices'],
mounted: function() {
console.log(this.image);
},
});
</script>
where $prices
json encoded array.
More From » arrays