Skip to content

Commit 2441be3

Browse files
authored
Update select
1 parent 6662222 commit 2441be3

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

input/Select.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ onMounted(() => {
7373
modelValue.value = null
7474
}
7575
76-
document.addEventListener('click', (e) => {
77-
let a = document.querySelectorAll('.custom-select-open')
78-
a.forEach((el) => el.click())
79-
})
76+
// document.addEventListener('click', (e) => {
77+
// let a = document.querySelectorAll('.custom-select-open')
78+
// a.forEach((el) => el.click())
79+
// })
8080
})
8181
8282
function updateClick(option = null) {
@@ -90,7 +90,7 @@ function updateClick(option = null) {
9090
inactive.value = false
9191
}
9292
open.value = false
93-
emit('update:modelValue', modelValue)
93+
emit('update:modelValue', modelValue.value)
9494
}
9595
9696
function renameKeys(obj = { id: '1', name: 'Alex' }, newKeys = { id: 'key', name: 'value' }) {

input/SelectPrefix.vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,14 @@ const filtered_options = ref(options)
3939
const uid = ref('custom-select-' + Date.now())
4040
4141
function openSelect() {
42-
console.log('Select click')
4342
let all = document.querySelectorAll('.custom-select-open')
4443
all.forEach((el) => {
4544
let data = el.dataset.uid ?? null
46-
console.log(data)
4745
if (data != uid.value) {
4846
el.click()
4947
}
5048
})
49+
5150
open.value = !open.value
5251
}
5352
@@ -63,10 +62,10 @@ onMounted(() => {
6362
clear()
6463
}
6564
66-
document.addEventListener('click', (e) => {
67-
let a = document.querySelectorAll('.custom-select-open')
68-
a.forEach((el) => el.click())
69-
})
65+
// document.addEventListener('click', (e) => {
66+
// let a = document.querySelectorAll('.custom-select-open')
67+
// a.forEach((el) => el.click())
68+
// })
7069
})
7170
7271
function clear() {
@@ -84,7 +83,7 @@ function updateClick(option = null) {
8483
inactive.value = false
8584
}
8685
open.value = false
87-
emit('update:modelValue', modelValue)
86+
emit('update:modelValue', modelValue.value)
8887
}
8988
9089
function filterOptions(e) {

0 commit comments

Comments
 (0)