Using VueJS with a Go backend

后端 未结 2 816
遇见更好的自我
遇见更好的自我 2021-01-02 18:26

I want to use Go templates as well as VueJS for data-binding. Has anyone integrated both before?

I wish to use VueJS primarily for Ajax calls as doing it manually(or

相关标签:
2条回答
  • 2021-01-02 18:41

    At the Go's side you can define your own delimiters: https://golang.org/pkg/text/template/#Template.Delims

    0 讨论(0)
  • 2021-01-02 18:46

    If you are mixing Vue.js with another templating system you can choose to change the interpolating delimiters (by default['{{','}}']) with something else.

    Vue.config.delimiters = ['${', '}']
    

    Now you can use {{.}} with golang and ${} with Vue

    0 讨论(0)
提交回复
热议问题