Vue + element UI实现搜索功能
如何用Vue+element实现搜索功能呢?接下来的代码可能会对你有帮助呦。//html<div class="search"><div class="demo-input-suffix"><el-autocompletev-model="state":fetch-sugg...
·
如何用Vue+element实现搜索功能呢?
接下来的代码可能会对你有帮助呦。
//html
<div class="search">
<div class="demo-input-suffix">
<el-autocomplete
v-model="state"
:fetch-suggestions="querySearchAsync"
@select="handleSelect"
placeholder="请输入内容"
>
<i slot="prefix" class="el-input__icon el-icon-search"></i>
</el-autocomplete>
</div>
</div>
<div class="search">
<div class="title">{{searchData.article_title}}</div>
<div class="content">{{searchData.article_context}}</div>
</div>
js 代码如下
data() {
return {
show:true,
notshow:false,
like_count: 10,
liked: false,
input4: "",
value: { color: "" },
style: { color: "red" },
tableData: [],
state: "",
restaurants: [],
timeout: null,
searchData:{}
};
},
更多推荐
已为社区贡献7条内容
所有评论(0)