Browse Source

fix(gui-v2): set default value for each option

pull/2984/head
Wing-Kam Wong 2 years ago
parent
commit
24809e3c06
  1. 7
      packages/nc-gui-v2/components/smartsheet-column/CurrencyOptions.vue
  2. 6
      packages/nc-gui-v2/components/smartsheet-column/DurationOptions.vue
  3. 11
      packages/nc-gui-v2/components/smartsheet-column/RatingOptions.vue

7
packages/nc-gui-v2/components/smartsheet-column/CurrencyOptions.vue

@ -57,6 +57,13 @@ const message = computed(() => {
function filterOption(input: string, option: Option) { function filterOption(input: string, option: Option) {
return option.value.toUpperCase().includes(input.toUpperCase()) return option.value.toUpperCase().includes(input.toUpperCase())
} }
// set default value
formState.value.meta = {
currency_locale: 'en-US',
currency_code: 'USD',
...formState.value.meta,
}
</script> </script>
<template> <template>

6
packages/nc-gui-v2/components/smartsheet-column/DurationOptions.vue

@ -10,6 +10,12 @@ const durationOptionList =
// h:mm:ss (e.g. 3:45, 1:23:40) // h:mm:ss (e.g. 3:45, 1:23:40)
title: `${o.title} ${o.example}`, title: `${o.title} ${o.example}`,
})) || [] })) || []
// set default value
formState.value.meta = {
duration: 0,
...formState.value.meta,
}
</script> </script>
<template> <template>

11
packages/nc-gui-v2/components/smartsheet-column/RatingOptions.vue

@ -32,6 +32,17 @@ const iconList = [
const advanced = ref(true) const advanced = ref(true)
const picked = ref(formState.value.meta.color || enumColor.light[0]) const picked = ref(formState.value.meta.color || enumColor.light[0])
// set default value
formState.value.meta = {
icons: {
full: 'mdi-star',
empty: 'mdi-star-outline',
},
color: '#fcb401',
max: 5,
...formState.value.meta,
}
</script> </script>
<template> <template>

Loading…
Cancel
Save