htmlbindingwebvue.jscomposite

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."


Solution

  • SOLVED: The problem is the XHTML validation, is very strict with tags, attributes, etc.

    The way to sort this validation is inset the code between < ![CDATA[ "blablabla" ]]>

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