Update Select.vue, filters.ts, Transaksi.vue, and Type17.vue files

This commit is contained in:
Dede Fuji Abdul
2024-04-23 15:03:25 +07:00
parent 355ff6aee8
commit 412412121e
6 changed files with 314 additions and 71 deletions

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import { ref, computed, watch } from 'vue';
import { RichSelect } from '@flavorly/vanilla-components';
import { ref, computed, watch } from 'vue'
import { RichSelect } from '@flavorly/vanilla-components'
const props = defineProps({
placeholder: {
@@ -23,7 +23,11 @@ const props = defineProps({
const emit = defineEmits(['update:selected'])
const data = computed(() =>
props.placeholder == '0' ? props.data : [{ id: 0, name: props.placeholder }, ...props.data]
props.placeholder == '0'
? props.data
: props.data.length > 0
? [{ id: 0, name: props.placeholder }, ...props.data]
: [{ id: 0, name: props.placeholder }]
)
const selected = ref(data.value[props.indexSelected].id)