Skip to content

✨ feat: add multiple mode feature #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions src/pages/IndexPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@
</q-dialog>

<q-page padding style="min-width: 400px">
<div class="row">
<q-checkbox
v-model="multipleMode"
label="Enter Multiple Mode"
/>
</div>
<div class="row">
<div class="col-xs-12 q-pa-sm">
<q-select
Expand All @@ -94,10 +100,11 @@
style="background-color: white;"
placeholder="Full Name, Email, Avatar, etc."
outlined
hide-selected
return-object
use-input
autofocus
:hide-selected="!multipleMode"
:multiple="multipleMode"
:options="options"
@filter="filterFn"
>
Expand All @@ -112,7 +119,7 @@
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<!-- TODO: remove condition when full bex feature is done -->
<q-item-section v-if="!isBex" avatar>
<q-item-section v-if="!isBex && !multipleMode" avatar>
<q-btn
icon="more_vert"
round
Expand Down Expand Up @@ -270,14 +277,14 @@ export default {

// Search
const searchSelectRef = ref(null);
const searchModel = ref(null);
let searchModel = ref(null);
const stringOptions = fakerMethods.map((method) => {
return {
label: method.searchNeedle,
value: method,
};
});
const options = ref();
const options = ref([]);
function filterFn (val, update) {
if (val === '') {
update(() => {
Expand All @@ -298,6 +305,14 @@ export default {
invokeFakerFn(val.value);
});

// Multiple mode
const multipleMode = ref(false);
watch(multipleMode, (val) => {
if (val) searchModel = ref([]);
else searchModel = ref(null);
console.warn('searchModel', searchModel.value);
});

const firstGenerateDialog = ref(false);
async function postActions ({ name, result }) {
if (typeof result === 'object') {
Expand Down Expand Up @@ -364,6 +379,7 @@ export default {
firstGenerateDialog,
fillOutFields,
isBex,
multipleMode,
};
},
};
Expand Down