Skip to content

Commit 43709a6

Browse files
committed
feat: enable search box for ace editor #412
1 parent c8502ad commit 43709a6

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

app/src/components/CodeEditor/CodeEditor.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<script setup lang="ts">
22
import { VAceEditor } from 'vue3-ace-editor'
33
import 'ace-builds/src-noconflict/mode-nginx'
4+
import ace from 'ace-builds'
45
import 'ace-builds/src-noconflict/theme-monokai'
6+
import extSearchboxUrl from 'ace-builds/src-noconflict/ext-searchbox?url'
57
import { computed } from 'vue'
68
79
const props = defineProps<{
@@ -21,10 +23,13 @@ const value = computed({
2123
emit('update:content', v)
2224
},
2325
})
26+
27+
ace.config.setModuleUrl('ace/ext/searchbox', extSearchboxUrl)
2428
</script>
2529

2630
<template>
2731
<VAceEditor
32+
ref="aceRef"
2833
v-model:value="value"
2934
lang="nginx"
3035
theme="monokai"

app/src/components/StdDesign/StdDataDisplay/StdTable.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,26 @@ watch(route, () => {
141141
params.trash = route.query.trash === 'true'
142142
})
143143
144+
const filterParams = reactive({})
145+
146+
watch(filterParams, () => {
147+
Object.assign(params, {
148+
...filterParams,
149+
page: 1,
150+
})
151+
})
152+
144153
onMounted(() => {
145154
if (!props.disableQueryParams) {
146155
Object.assign(params, {
147156
...route.query,
148157
trash: route.query.trash === 'true',
149158
})
159+
160+
Object.assign(filterParams, {
161+
...route.query,
162+
trash: route.query.trash === 'true',
163+
})
150164
}
151165
152166
get_list()
@@ -429,7 +443,7 @@ const paginationSize = computed(() => {
429443
v-if="!disableSearch && searchColumns.length"
430444
:key="updateFilter"
431445
:data-list="searchColumns"
432-
:data-source="params"
446+
:data-source="filterParams"
433447
type="search"
434448
layout="inline"
435449
>

0 commit comments

Comments
 (0)