报错内容:

报错原文:

vue.runtime.esm.js?a593:619 [Vue warn]: Property or method "value" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

原因:

绑定的value变量并没有定义,重新定义一下

<a-select v-model="value" size="small" placeholder="请选择" @change="init" style="width: 90%;margin-top: 20px">
            <a-select-option v-for="item in locationOptions" :key="item.value">
                 {{ item.label }}
            </a-select-option>
        </a-select>

解决:

重新定一下一个变量selectLocationOptions,

selectLocationOptions: '120.12979, 30.25949',
      locationOptions: [{
        label: '西湖区',
        value: '120.12979, 30.25949'
      }, {
        label: '萧山区',
        value: '120.267827, 30.186424'
      }, {
        label: '临安区',
        value: '119.725056, 30.234302'
      }],

总结:这其实都是很小的问题,所以要检查检查

Logo

前往低代码交流专区

更多推荐