Vue.js 输入表单不工作-正在更新引导vue版本

Vue.js 输入表单不工作-正在更新引导vue版本,vue.js,bootstrap-vue,Vue.js,Bootstrap Vue,我使用的是一个表单,其中一个输入中有一个数字字段,但是在编辑行时打开表单的模式时,会显示以下错误: [Vue warn]:无效的属性:属性“值”的类型检查失败。应为值为“1”的字符串,获取值为1的数字 我的代码: <b-col md="6" sm="12"> <b-form-group label="Code:" label-for="institution-code" la

我使用的是一个表单,其中一个输入中有一个数字字段,但是在编辑行时打开表单的模式时,会显示以下错误:

[Vue warn]:无效的属性:属性“值”的类型检查失败。应为值为“1”的字符串,获取值为1的数字

我的代码:

    <b-col md="6" sm="12">
        <b-form-group label="Code:" label-for="institution-code" label-size="sm" class="mt-0 mb-0">
            <b-form-input id="institution-code"
                label-for="institution-code"
                size="sm"
                type="number"
                v-model="institution.code" required
                placeholder="Insert code..." />
        </b-form-group>
    </b-col>
</template>

export default {
data: function() {
    return {
        institution: {},

导出默认值{
数据:函数(){
返回{
机构:{},
旧版本:“引导vue”:“2.0.0-rc.11”,

    <b-col md="6" sm="12">
        <b-form-group label="Code:" label-for="institution-code" label-size="sm" class="mt-0 mb-0">
            <b-form-input id="institution-code"
                label-for="institution-code"
                size="sm"
                type="number"
                v-model.number="institution.code" required
                placeholder="Insert code..." />
        </b-form-group>
    </b-col>
</template>

export default {
data: function() {
    return {
        institution: {},
新版本:“引导vue”:“2.0.0-rc.12”,

    <b-col md="6" sm="12">
        <b-form-group label="Code:" label-for="institution-code" label-size="sm" class="mt-0 mb-0">
            <b-form-input id="institution-code"
                label-for="institution-code"
                size="sm"
                type="number"
                v-model.number="institution.code" required
                placeholder="Insert code..." />
        </b-form-group>
    </b-col>
</template>

export default {
data: function() {
    return {
        institution: {},

我的代码有什么问题?

将v-model.number更改为v-model=“your property”

将v-model.number更改为v-model=“your property”

我需要更新到工作版本:

新版本:“引导vue”:“2.0.0-rc.13”,

    <b-col md="6" sm="12">
        <b-form-group label="Code:" label-for="institution-code" label-size="sm" class="mt-0 mb-0">
            <b-form-input id="institution-code"
                label-for="institution-code"
                size="sm"
                type="number"
                v-model.number="institution.code" required
                placeholder="Insert code..." />
        </b-form-group>
    </b-col>
</template>

export default {
data: function() {
    return {
        institution: {},

导出默认值{
数据:函数(){
返回{
机构:{},

我需要更新到工作版本:

新版本:“引导vue”:“2.0.0-rc.13”,

    <b-col md="6" sm="12">
        <b-form-group label="Code:" label-for="institution-code" label-size="sm" class="mt-0 mb-0">
            <b-form-input id="institution-code"
                label-for="institution-code"
                size="sm"
                type="number"
                v-model.number="institution.code" required
                placeholder="Insert code..." />
        </b-form-group>
    </b-col>
</template>

export default {
data: function() {
    return {
        institution: {},

导出默认值{
数据:函数(){
返回{
机构:{},

我应该在哪里修改它?在输入中我已经定义了type=“number”为什么使用v-model.number?希望您知道v-model在您的输入中充当数据绑定,这有助于自动更新输入值。因此,既然机构是一个对象,也是保存输入值的属性,您应该这样做。v-model=“institution.prop”prop应该是你的对象属性。你的输入类型编号,已经为你处理过了。导出默认值{data:function(){return{institution:{},我在哪里修改它?在输入中我已经定义了type=“number“为什么使用v-model.number?希望您知道v-model在您的输入中充当数据绑定,这有助于自动更新输入值。因此,既然机构是一个对象,也是保存输入值的属性,您应该这样做。v-model=“institution.prop”prop应该是您的对象属性。您的输入类型编号已经为您处理了。导出默认值{data:function(){return{institution:{},您不应该在
b-input
上使用
v-model.number
,因为Vue不支持自定义组件上的
v-model
修饰符。请使用
number
道具。@Hiws我已经尝试使用道具编号,但我的v-model是一个对象,无法将道具用作对象。您能告诉我如何操作吗,因为我已经阅读了文档,但仍然不理解。
只接受
字符串或
数字。它不支持对象。在版本“bootstrap vue”中:“2.0.0-rc.11”,这是完全可以接受的,只是更新开始显示这些错误。您不应该在
b-input
上使用
v-model.number
,因为Vue不支持自定义组件上的
v-model
修饰符。而应该使用
number
道具。@Hiws我已经尝试使用道具编号,但我的v-model是一个对象t和我无法将道具用作对象。您能告诉我怎么做吗,因为我已经阅读了文档,但仍然不理解它。
只接受
字符串或
数字。它不支持对象。在版本“bootstrap vue”中:“2.0.0-rc.11”,这是完全可以接受的,只有更新开始显示这些错误。