Answer the question
In order to leave comments, you need to log in
How to use vuejs and golang?
Hello, there is a problem.
I'm using vuejs and golang, the problem is that
I can't display value from data
<div class="online">
Онлайн
<p>{{ onlineuser }}</p>
</div>
new Vue({
el: '#main',
data: {
onlineuser: 0,
},
.....
})
Answer the question
In order to leave comments, you need to log in
You can change the delimiters {{.}} in Go template to any other https://golang.org/pkg/html/template/#Template.DelimsmyTemplate.Delims("<<", ">>")
Why use templates in Go only to use them in Vue.js? You can give files just static, without processing. Or, as already mentioned above, replace the separators in one of the template engines.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question