mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 19:05:55 +02:00
feat: enable search box for ace editor #412
This commit is contained in:
parent
c8502ad7bf
commit
020a9ba2f2
2 changed files with 19 additions and 1 deletions
|
@ -1,7 +1,9 @@
|
|||
<script setup lang="ts">
|
||||
import { VAceEditor } from 'vue3-ace-editor'
|
||||
import 'ace-builds/src-noconflict/mode-nginx'
|
||||
import ace from 'ace-builds'
|
||||
import 'ace-builds/src-noconflict/theme-monokai'
|
||||
import extSearchboxUrl from 'ace-builds/src-noconflict/ext-searchbox?url'
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = defineProps<{
|
||||
|
@ -21,6 +23,8 @@ const value = computed({
|
|||
emit('update:content', v)
|
||||
},
|
||||
})
|
||||
|
||||
ace.config.setModuleUrl('ace/ext/searchbox', extSearchboxUrl)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
@ -141,12 +141,26 @@ watch(route, () => {
|
|||
params.trash = route.query.trash === 'true'
|
||||
})
|
||||
|
||||
const filterParams = reactive({})
|
||||
|
||||
watch(filterParams, () => {
|
||||
Object.assign(params, {
|
||||
...filterParams,
|
||||
page: 1,
|
||||
})
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
if (!props.disableQueryParams) {
|
||||
Object.assign(params, {
|
||||
...route.query,
|
||||
trash: route.query.trash === 'true',
|
||||
})
|
||||
|
||||
Object.assign(filterParams, {
|
||||
...route.query,
|
||||
trash: route.query.trash === 'true',
|
||||
})
|
||||
}
|
||||
|
||||
get_list()
|
||||
|
@ -429,7 +443,7 @@ const paginationSize = computed(() => {
|
|||
v-if="!disableSearch && searchColumns.length"
|
||||
:key="updateFilter"
|
||||
:data-list="searchColumns"
|
||||
:data-source="params"
|
||||
:data-source="filterParams"
|
||||
type="search"
|
||||
layout="inline"
|
||||
>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue