TriStateCheckbox does not accept undefined types

UI Components for Vue
Post Reply
yasbb
Posts: 3
Joined: 27 Apr 2022, 21:00

27 Apr 2022, 21:11

TriStateCheckbox is used to select either "true", "false" or "null" as the value. But my API returns boolean and undefined types, and changing this in the API is unfeasible, so the TriStateCheckbox doesn't work correctly.

how can i get around this situation?

yasbb
Posts: 3
Joined: 27 Apr 2022, 21:00

06 May 2022, 22:08

solve this problem as follows:

Code: Select all

const variable = ref<boolean | null>(null);

// "props.filter" is a filter class of my api
watch(() => variable.value, () => {
	props.filter.variable = variable.value == null ? undefined : variable.value;
}, { deep: true });

tugce.kucukoglu
Posts: 560
Joined: 23 Oct 2020, 09:28

09 Jun 2022, 16:35

Hi,

Sorry for the late answer. It might be core issue. If problem is still persist, could you please create an issue on Github?

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 17 guests