I followed all the steps of Jeffrey way's vuejs tutorial at laracast but still I'm getting failed to resolve component when calling the currentView in the app.blade.php from the app.js data. But when I explicitly call the checkout-view page (component is="checkout-view") it's working fine. How can I solve this since I want to reference the checkout-view with currentView? Below are my code:
app.blade.php
<body class="container">
<div id="app">
<component is="@{{currentView}}"></component>
</div>
<script type="text/javascript" src="/js/app.js"></script>
</body>
</html>
app.js
var Vue = require('vue');
new Vue({
el: '#app',
data:{
currentView: 'checkout-view'
},
components: {
'checkout-view' : require('./views/checkout')
}
});
checkout.js
module.exports = {
template: require('./checkout.template.html'),
components: {
coupon: require('../components/Coupon.js')
}
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire