use lodash plug-in to realize real-time retrieval of input and report errors
Page Code:
<div class="search">
<input type="text" v-model="condition" placeholder="" v-on:input="lodashSearch">
<span class="search-icon" @click.stop="getSearchCommunity">
<i class="iconfont icon-w_search_normal"></i>
</span>
</div>
after downloading ladash dependencies using npm, introduce lodash
import _ from "lodash"
methods method:
//
lodashSearch: _.debounce(() => {
this.getSearchCommunity(); // debounce
}, 400),
error report:
lodashresize
:
lodash?
:
therefore the arrow function cannot be used in methods