v-bind error:v-bind' is an undeclared prefix v-bind error:v-bind' is an undeclared prefix vue.js vue.js

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


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: andv-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), addthese 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 theoutput – otherwise the definitions will be repeated everywhere.


v-bind can bind without : like below:

<option v-for="option in options" v-bind="{value: option.value}">{{option.text}}</option>

is equals

<option v-for="option in options" v-bind:value="option.value">{{option.text}}</option>

cf. Vue.js#v-bind


It's not a problem about vuejs as this fiddle shows. The Razor Template engine does not know the namespace v-bind: and only : is invalid xml.You need to tell the template engine about the namespaces of vuejs. Here is another stack overflow article about adding custom namespaces to Razor template engine.