refactor
parent
98dbb467d7
commit
b4714e8740
|
@ -325,8 +325,6 @@ import { ref, onMounted } from 'vue';
|
||||||
import {FilterMatchMode,FilterService} from 'primevue/api';
|
import {FilterMatchMode,FilterService} from 'primevue/api';
|
||||||
import CustomerService from './service/CustomerService';
|
import CustomerService from './service/CustomerService';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
setup() {
|
setup() {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -335,7 +333,7 @@ export default {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
FilterService.register(YOUR_FILTER, (value, filter) => {
|
FilterService.register(YOUR_FILTER.value, (value, filter) => {
|
||||||
if (filter === undefined || filter === null || filter.trim() === '') {
|
if (filter === undefined || filter === null || filter.trim() === '') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -352,11 +350,11 @@ export default {
|
||||||
const customers = ref();
|
const customers = ref();
|
||||||
const customerService = ref(new CustomerService());
|
const customerService = ref(new CustomerService());
|
||||||
const filters = ref({
|
const filters = ref({
|
||||||
'name': {value: null, matchMode: YOUR_FILTER},
|
'name': {value: null, matchMode: YOUR_FILTER.value},
|
||||||
'country.name': {value: null, matchMode: FilterMatchMode.STARTS_WITH}
|
'country.name': {value: null, matchMode: FilterMatchMode.STARTS_WITH}
|
||||||
});
|
});
|
||||||
const matchModeOptions = ref([
|
const matchModeOptions = ref([
|
||||||
{label: 'Your Equals', value: YOUR_FILTER},
|
{label: 'Your Equals', value: YOUR_FILTER.value},
|
||||||
{label: 'Starts With', value: FilterMatchMode.STARTS_WITH}
|
{label: 'Starts With', value: FilterMatchMode.STARTS_WITH}
|
||||||
]);
|
]);
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
|
|
Loading…
Reference in New Issue