0👍
Workaround to it is to pass html generation to function, so html file is replaced with
{{ range $el := index . "metaTags" }}
{{$el|meta}}
{{ end }}
and we register a function to create HTML
template.FuncMap{
"meta": func(s api.Tag) template.HTML {
return template.HTML("<meta " + s.Key + "=\"" + s.Name + "\" " + s.Type + "=\"" + s.Content + "\" data-vue-router-controlled />")
},
}
Struct
type Tag struct {
Key string `json:"key"`
Name string `json:"name"`
Type string `json:"type"`
Content string `json:"content"`
}
- [Vuejs]-How to change a global CSS Bootstrap in specific component in Vue.js?
- [Vuejs]-Modifying 4 variable in one click in vue
Source:stackexchange.com