Skip to content

Commit 0ad799e

Browse files
committed
refactor: Added vbind and von in adap-searchfield
1 parent ba0f367 commit 0ad799e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/AdapSearchfield.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
const template = `
22
<input type="text"
33
v-if="collection"
4-
class="adap-searchfield"
4+
v-bind="vBind"
5+
v-on="vOn"
56
v-model="collection.search"
7+
class="adap-searchfield"
68
@keyup="search"
79
/>
810
`
@@ -20,6 +22,16 @@ export class AdapSearchfield extends Vue {
2022
@Prop({ type: Number, default: 1000 })
2123
debounceTimer!: number
2224

25+
get vBind() {
26+
return { ...this.$attrs }
27+
}
28+
29+
get vOn() {
30+
const listeners = { ...this.$listeners }
31+
delete listeners.input
32+
return { ...listeners }
33+
}
34+
2335
get querySearch(): () => Promise<any> {
2436
return debounce(() => this.debounceQuerySearch(), this.debounceTimer)
2537
}

0 commit comments

Comments
 (0)