第一次使用可查询的select结果把数据库请求崩溃了,呜呜呜~~~~~~~~~~~~
看代码:
<el-select
v-model="testValue"
multiple
filterable
remote
reserve-keyword
placeholder="请输入关键词"
:remote-method="testMethod()"
:loading="loading">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
为什么呢??????????????
那是因为我写成:remote-method=“testMethod()”,给方法加了括号所以前端就不断的请求后端进行查询了。
正确的代码应该是:
<el-select
v-model="testValue"
multiple
filterable
remote
reserve-keyword
placeholder="请输入关键词"
:remote-method="testMethod"
:loading="loading">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>