Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

v-bind error:v-bind' is an undeclared prefix

I'm working in asp.net with Orckestra CMS (before Composite) and Razor Templates and trying to use Vue framework.

All is fine when using {{option.text}}

<select class="form-control" id="myExample1">
     <option v-for="option in options">{{option.text}}</option>
</select>

But when I insert v-bind attribute, the page is broken:

<select class="form-control" id="myExample1">
     <option v-for="option in options" v-bind:value="option.value">{{option.text}}</option>
</select>

Rendering page fail and show "Error: 'v-bind' is an undeclared prefix."

like image 825
Ezequiel Fdeil Avatar asked Mar 11 '23 01:03

Ezequiel Fdeil


1 Answers

Maybe it's too late, but for those who searching, I found good solution from here:

Well-formed XML cannot use the : and @ shortcuts for v-bind: and v-on:. And in XML these attributes are interpreted as namespace names.

To use the v-bind: and v-on: syntax in XML (e.g. XSLT files), add these as dummy namespaces in the XML, e.g.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:v-bind="https://vuejs.org/v2/api/#v-bind"
 xmlns:v-on="https://vuejs.org/v2/api/#v-on">

Then also add the dummy xmlns:v-bind to the <html> element of the output – otherwise the definitions will be repeated everywhere.

like image 98
kai2k Avatar answered Mar 19 '23 18:03

kai2k