修复证书路径输入光标跳转
Some checks are pending
Security Checks / security (push) Waiting to run

This commit is contained in:
smail 2026-09-08 10:06:51 +08:00
parent c4f53f28e9
commit b32a41151b
3 changed files with 5 additions and 3 deletions

View File

@ -46,7 +46,7 @@ export function useField(props, emit) {
watch(() => props.value, value => {
const nextValue = typeof value === 'string' ? value : ''
if (!textEditing.value || nextValue !== textValue.value) {
if (!textEditing.value) {
textValue.value = nextValue
}
})

View File

@ -351,6 +351,8 @@ test('普通文本输入使用本地编辑值,父级配置刷新不会抢占
assert.match(script, /const textValue = ref\(/)
assert.match(script, /const textEditing = ref\(false\)/)
assert.match(script, /watch\(\(\) => props\.value/)
assert.match(script, /if \(!textEditing\.value\)\s*\{\s*textValue\.value = nextValue/)
assert.doesNotMatch(script, /!textEditing\.value \|\| nextValue !== textValue\.value/)
})
test('统一加密方式同步切换 SMTP、IMAP、POP3 与已配置中继', () => {

View File

@ -43,8 +43,8 @@ test('网络和文本列表跨页编辑、添加、删除仅更新目标条目',
const fieldSource = readFileSync(new URL('ConfigField/ConfigField.js', root), 'utf8')
const useField = compileFunction(
fieldSource.replace(/^import .*$/gm, '').replace(/^export \{.*$/gm, '').replace('export function', 'function') + '\nreturn useField',
['computed', 'nextTick', 'fieldKey', 'usePagination']
)(computed, nextTick, field => field.path.join('.'), usePagination)
['computed', 'nextTick', 'ref', 'watch', 'fieldKey', 'usePagination']
)(computed, nextTick, ref, watch, field => field.path.join('.'), usePagination)
for (const type of ['list', 'network']) {
const scope = effectScope()
const value = ref(type === 'list' ? ['a.example', 'b.example', 'c.example'] : [