Skip to content

Commit 8ca4aa1

Browse files
committed
refactor: streamline event handling in ListSelect component
- Replaced the AsyncSelect import with InfiniteSelect for improved functionality. - Simplified the handleChange method to emit events more clearly, enhancing code readability and maintainability.
1 parent 37a73f8 commit 8ca4aa1

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

packages/business/src/views/api-application/ListSelect.vue

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script>
22
import { appApi } from '@tap/api'
3-
import { AsyncSelect } from '@tap/form'
4-
import { $emit, $off, $on, $once } from '../../../utils/gogocodeTransfer'
3+
import { InfiniteSelect as AsyncSelect } from '@tap/form'
54
65
export default {
76
name: 'ListSelect',
@@ -41,15 +40,9 @@ export default {
4140
handleChange(opt) {
4241
const { label } = opt
4342
this.form.label = label
44-
$emit(
45-
this.$emit('update:value', this.form.value).$emit(
46-
'update:label',
47-
this.form.label,
48-
),
49-
'change',
50-
val,
51-
opt,
52-
)
43+
this.$emit('change', this.form.value, opt)
44+
this.$emit('update:value', this.form.value)
45+
this.$emit('update:label', this.form.label)
5346
},
5447
5548
async getData(filter = {}) {

0 commit comments

Comments
 (0)