<template>
<div>
<el-input
v-model="pages.value"
@input="select"
@keyup.enter.native="select"
clearable placeholder="请输入内容"
class="input-with-select">
<el-button slot="append" icon="el-icon-search"></el-button>
</el-input>
</div>
</template>
<script>
import { 抛出的数据 } from "API 路径";
import _ from "lodash";
export default {
name: '',
props: {},
data() {
return {
pages:{
value: ' ',
· · ·
}
};
},
// 子组件转换
components: {},
// 数据引入 created
created() {
this.orders() // 数据调用
},
mounted() {
},
//点击函数事件
methods: {
select: _.throttle(function () { // lodash 组件
console.log(this.value)
this.orders()
}, 2000),
orders() {
ordersList(this.pages).then(res => {
})
},
},
//计算事件
computed: {},
//数据监听
watch: {},
//过滤器
filters: {},
//设定自定义指令
directives: {},
}
</script>
<style lang="scss" scoped>
</style>
lodash搜索的使用
最新推荐文章于 2022-10-12 10:07:28 发布