V
V
Vadim kyklaed2018-03-26 16:32:38
Django
Vadim kyklaed, 2018-03-26 16:32:38

How to use vue js + django?

Good afternoon!
Can't launch vue with janga
in header declared

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

<div id="app-3">
  <span v-if="seen">Сейчас меня видно</span>
</div>

var app3 = new Vue({
  el: '#app-3',
  data: {
    seen: true
  }
})

for a start I tried to run the html body directly. ZERO effect. in the console, only a greeting from vue and no errors. static collected. static files are connected to html. What is the problem I do not understand. I didn't find clear guides.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lavezzi1, 2018-03-27
@lavezzi1

data is always a function that returns an object.

var app3 = new Vue({
  el: '#app-3',
  data() {
    return {
      seen: true
    }
  }
})

S
Serhiy Romanov, 2018-03-26
@SerhiyRomanov

Take a look at this tutorial, maybe it will help you understand some points.
https://github.com/michaelbukachi/django-vuejs-tut...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question