Skip to content

Commit

Permalink
Feat: Use vue-multiselect in Edit Tag
Browse files Browse the repository at this point in the history
  • Loading branch information
chakflying committed May 7, 2023
1 parent 8a3bce4 commit fcfe13e
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions src/components/TagEditDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,26 @@
</button>
</router-link>
</div>
<div v-if="allMonitorList.length > 0" class="pt-3 px-3">
<div v-if="allMonitorList.length > 0" class="pt-3">
<label class="form-label">{{ $t("Add a monitor") }}:</label>
<select v-model="selectedAddMonitor" class="form-control">
<option v-for="monitor in allMonitorList" :key="monitor.id" :value="monitor">{{ monitor.name }}</option>
</select>
<VueMultiselect
v-model="selectedAddMonitor"
:options="allMonitorList"
:multiple="false"
:searchable="true"
:placeholder="$t('Add a monitor')"
label="name"
trackBy="name"
class="mt-1"
>
<template #option="{ option }">
<div
class="d-inline-flex"
>
<span>{{ option.name }} <Tag v-for="monitorTag in option.tags" :key="monitorTag" :item="monitorTag" :size="'sm'" /></span>
</div>
</template>
</VueMultiselect>
</div>
</div>
</div>
Expand All @@ -107,6 +122,7 @@
<script>
import { Modal } from "bootstrap";
import Confirm from "./Confirm.vue";
import Tag from "./Tag.vue";
import VueMultiselect from "vue-multiselect";
import { colorOptions } from "../util-frontend";
import { useToast } from "vue-toastification";
Expand All @@ -117,6 +133,7 @@ export default {
components: {
VueMultiselect,
Confirm,
Tag,
},
props: {
updated: {
Expand Down

0 comments on commit fcfe13e

Please sign in to comment.