Merge branch 'net' into development
This commit is contained in:
commit
10a63f26e2
3 changed files with 50 additions and 51 deletions
|
|
@ -1,6 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, onUnmounted, ref } from 'vue'
|
||||
|
||||
const storesKeyword = ['test1', 'test2', 'test3', 'test4', 'test5']
|
||||
const filterOptions = ref(storesKeyword)
|
||||
const inputKeyword = ref<string[]>([])
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
open: boolean
|
||||
|
|
@ -16,7 +20,7 @@ const props = withDefaults(
|
|||
}>(),
|
||||
{
|
||||
open: false,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
const emit = defineEmits([
|
||||
|
|
@ -56,6 +60,29 @@ function submit() {
|
|||
emit('update:open', !open), reset()
|
||||
}
|
||||
|
||||
function createkeyword(val, done) {
|
||||
if (val.length > 2) {
|
||||
if (!inputKeyword.value.includes(val)) {
|
||||
inputKeyword.value.push(val)
|
||||
done(val, 'add-unique')
|
||||
console.log(inputKeyword.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function filterkeyword(val, update) {
|
||||
update(() => {
|
||||
if (val === '') {
|
||||
filterOptions.value = storesKeyword
|
||||
} else {
|
||||
const needle = val.toLowerCase()
|
||||
filterOptions.value = storesKeyword.filter(
|
||||
(v) => v.toLowerCase().indexOf(needle) > -1
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => window.addEventListener('keydown', keydown))
|
||||
onUnmounted(() => window.addEventListener('keydown', keydown))
|
||||
|
||||
|
|
@ -157,14 +184,26 @@ const file = ref<File | undefined>()
|
|||
|
||||
<section class="q-mb-md">
|
||||
<span class="text-weight-bold">คำสำคัญ</span>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="q-mt-sm"
|
||||
placeholder="คำสำคัญ"
|
||||
:model-value="keyword"
|
||||
@update:model-value="(v) => $emit('update:keyword', v)"
|
||||
/>
|
||||
<div class="q-mt-md">
|
||||
<q-select
|
||||
outlined
|
||||
v-model="inputKeyword"
|
||||
use-input
|
||||
use-chips
|
||||
multiple
|
||||
input-debounce="0"
|
||||
@new-value="createkeyword"
|
||||
:options="filterOptions"
|
||||
@filter="filterkeyword"
|
||||
style="width: 250px"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey"> No results </q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section :style="{ display: 'flex', gap: '.5rem' }">
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ const onRowClick = (evt: Event, row: TreeDataFolder, index: number) => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div class="q-pa-md">
|
||||
<div class="q-mt-md">
|
||||
<div class="q-gutter-sm">
|
||||
<div
|
||||
class="flex flex-break d justify-between space-between"
|
||||
|
|
@ -331,7 +331,7 @@ const onRowClick = (evt: Event, row: TreeDataFolder, index: number) => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="q-pa-md" v-if="currentDept >= 3">
|
||||
<div class="q-mt-md" v-if="currentDept >= 3">
|
||||
<div class="q-gutter-sm">
|
||||
<div class="flex flex-break d justify-between space-between">
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -1,40 +0,0 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import TagInput from "@mayank1513/vue-tag-input";
|
||||
import "@mayank1513/vue-tag-input/style.css";
|
||||
|
||||
const autocompleteItems = [
|
||||
"No dependencies",
|
||||
"Autocompletion",
|
||||
"Keep Focused",
|
||||
"Fast Settup",
|
||||
"Mini Sized",
|
||||
"Customizable",
|
||||
"Backspace/Delete to remove tag",
|
||||
"Turns red when backspace/delete is pressed",
|
||||
"Examples",
|
||||
"Docs",
|
||||
"Copy/Paste",
|
||||
]
|
||||
const tags = ref<string[]>([]);
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-btn @click="()=> {console.log(tags);
|
||||
}">test</q-btn>
|
||||
<tag-input tagBgColor="rgb(189, 184, 179)" :autocomplete-items="autocompleteItems" v-model="tags" />
|
||||
<!-- <q-btn
|
||||
class="q-px-md"
|
||||
label="บันทึก"
|
||||
type="submit"
|
||||
color="primary"
|
||||
dense
|
||||
@click="
|
||||
() => {
|
||||
$emit('update:drawerFile')
|
||||
|
||||
}
|
||||
"
|
||||
/> -->
|
||||
</template>
|
||||
Loading…
Add table
Add a link
Reference in a new issue