F
F
Fedor Lapshin2019-01-17 15:51:39
go
Fedor Lapshin, 2019-01-17 15:51:39

Conflict between VueJS templates and Go templates, how to fix?

Trying to change template call signs:

tmp,err := template.New("...").Delims("").ParseFiles("...")

tmp.Execute(w,...)

or

tmp := template.New("...")
tmp.Delims("")
tmp.ParseFiles("...")


give a blank page

and when changing signs in Vue.JS:
Vue.config.delims = [''] /*или*/ new Vue({ delims : [''] })
nothing changes!

complete html code
<!-- {{ `{{  }}` }} -->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <!-- <link rel="stylesheet" href="{{ .Dirpath }}/style.css">
    <script src="{{ .Dirpath }}/index.js"></script> -->
    {{ template "include" .}}


    <title>{{ .Title }}</title>
</head>
<body>
    <header>{{ template "header" }}</header>

    <!-- {{ `{{ }}` }} -->
    <div id="VueROOT">
        <card title="one">{{ test }}</card> <!-- card is vuejs component; test - vuejs template -->
    </div>
test

    <footer>{{ template "footer" }}</footer>
</body>
</html>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fedor Lapshin, 2019-02-14
@FedLapshin06

I just had to do Execute by define "..." in the file, a banal mistake!

0
0xD34F, 2019-01-17
@0xD34F Vue.js

Well, I won’t say anything about Go, but as for
, then this property is:
1. Not set via Vue.config (possible via Vue.options)
2. Named differently

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question