Answer the question
In order to leave comments, you need to log in
Why is the vue component not rendering?
Hello, I have such a js file that is going to webpack in build.js file
// import dependens
import Vue from 'vue';
Vue.config.productionTip = false
import CheckoutHeader from './checkout/CheckoutHeader.vue'
import axios from 'axios'
import _ from 'lodash'
new Vue({
el: '#checkoutApp',
data: {
rrr: 123,
},
components: {
CheckoutHeader
},
methods: {
reloadCart() {}
},
mounted() {
}
});
<script src="/dev/build.js"></script>
<div id="checkoutApp">
<checkout-header></checkout-header>
{{ rrr }}
<div class="order_title">Оформление заказа VUE</div>
</div>
Answer the question
In order to leave comments, you need to log in
If you set up webpack:
1. index.html
<div id="app-root"></div>
<script src="/dev/build.js"></script>
import Vue from 'vue';
import App from './App.vue'
Vue.config.productionTip = false;
new Vue({
el: '#app-root',
render: (h) => h(App),
});
<template>
<div>
<checkout-header></checkout-header>
{{ rrr }}
<div class="order_title">Оформление заказа VUE</div>
</div>
</template>
<script>
import CheckoutHeader from './checkout/CheckoutHeader.vue'
import axios from 'axios'
import _ from 'lodash'
export default {
data: () => ({
rrr: 123,
}),
components: {
CheckoutHeader
},
methods: {
reloadCart() {}
},
}
</script>
You forgot to mount all this happiness in the right house-element. Therefore, there are no errors and everything is clean in the console. There is just a view instance that is not connected to anything and a non-interactive template
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question