Skip to content

Commit 798d1b8

Browse files
authored
Merge pull request #35 from vue-pivottable/fix/vdropdown-valueModel
fix: fix initial value in VDropDown.vue
2 parents 497bcea + b975882 commit 798d1b8

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/components/pivottable-ui/VAggregatorCell.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
:key="i"
3838
:options="valsOptions"
3939
:value="vals[i]"
40-
@update:value="(val, i) => updateVals(val, i)"
40+
@update:value="(val) => updateVals(val, i)"
4141
>
4242
</VDropdown>
4343
</template>

src/components/pivottable-ui/VDropdown.vue

+2-4
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ const props = defineProps({
2626
default: ''
2727
}
2828
})
29-
const valueModel = ref(props.value)
29+
const valueModel = ref(props.value || props.options[0])
3030
const emit = defineEmits(['update:value'])
3131
watch(valueModel, (newVal) => {
3232
emit('update:value', newVal)
33-
})
33+
}, { immediate: true })
3434
</script>
35-
36-
// v-model 구현

src/components/pivottable-ui/VFilterBox.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ const props = defineProps({
9090
}
9191
})
9292
const { localeStrings, sorter, menuLimit } = useProvideFilterBox()
93-
console.log(localeStrings)
9493
const filterBoxValuesList = Object.keys(props.filterBoxValues)
9594
const filterText = ref('')
9695
const showMenu = ref(filterBoxValuesList.length < menuLimit)
@@ -117,6 +116,7 @@ const addValuesToFilter = (values) => {
117116
emit('update:unselectedFilterValues', { key: props.filterBoxKey, value: filterValues })
118117
}
119118
const removeValuesFromFilter = (values) => {
119+
console.log(values)
120120
const filterValues = values.reduce((r, v) => {
121121
if (r[v]) {
122122
delete r[v]

0 commit comments

Comments
 (0)