Answer the question
In order to leave comments, you need to log in
How to properly connect vue js to the site?
There is a site on django and on the client side you need to implement blocks with complex logic written in vue js.
I used to connect like this:
import prostayaLogika from './components/prostaya_logika'
import slozhnayaLogika from './components/slozhnaya_logika'
if (!!document.getElementById('slozhnaya-logika'))
new Vue({
el: '#slozhnaya-logika',
render: h => h(slozhnayaLogika)
});
if (!!document.getElementById('prostaya-logika'))
new Vue({
el: '#prostaya-logika',
render: h => h(prostayaLogika)
});
import logikaOne from './components/logika_one'
import logikaTwo from './components/logika_two'
import logikaThree from './components/logika_three'
new Vue({
el: '#app',
components:{
logikaOne,
logikaTwo,
logikaThree
},
})
<!-- много html кода -->
<logikaOne></logikaOne>
<logikaTwo></logikaTwo>
<logikaThree></logikaThree>
<!-- много html кода -->
Answer the question
In order to leave comments, you need to log in
I don't think this method is very nice.
but this option will not work on the site, since you will have to display tags of the form
<div is="logikaOne">
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question