gpt4 book ai didi

html - v 绑定(bind)错误 :v-bind' is an undeclared prefix

转载 作者:搜寻专家 更新时间:2023-10-30 22:27:36 24 4
gpt4 key购买 nike

我在 asp.net 中使用 Orckestra CMS(在 Composite 之前)和 Razor 模板工作,并尝试使用 Vue 框架。

使用 {{option.text}} 一切正常

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

但是当我插入 v-bind 属性时,页面被破坏了:

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

呈现页面失败并显示“错误:‘v-bind’是未声明的前缀。”

最佳答案

也许为时已晚,但对于那些正在搜索的人,我找到了很好的解决方案 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.

关于html - v 绑定(bind)错误 :v-bind' is an undeclared prefix,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41875921/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com