mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-08 22:51:25 +08:00
关键词及标签不必敲下回车即可添加
This commit is contained in:
parent
6996bef1b7
commit
b78195cd59
@ -130,13 +130,15 @@
|
|||||||
v-model="cmdMatch"
|
v-model="cmdMatch"
|
||||||
max-values="3"
|
max-values="3"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="键入后回车"
|
placeholder="回车添加多个"
|
||||||
use-input
|
use-input
|
||||||
use-chips
|
use-chips
|
||||||
multiple
|
multiple
|
||||||
new-value-mode="add-unique"
|
new-value-mode="add-unique"
|
||||||
input-debounce="0"
|
input-debounce="0"
|
||||||
:label="cmdType.matchLabel"
|
:label="cmdType.matchLabel"
|
||||||
|
ref="cmdMatchRef"
|
||||||
|
@blur="(e) => autoAddInputVal(e, $refs.cmdMatchRef)"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon color="primary" name="square_foot" />
|
<q-icon color="primary" name="square_foot" />
|
||||||
@ -173,7 +175,7 @@
|
|||||||
max-values="3"
|
max-values="3"
|
||||||
type="text"
|
type="text"
|
||||||
label="标签"
|
label="标签"
|
||||||
placeholder="键入后回车"
|
placeholder="回车添加多个"
|
||||||
use-input
|
use-input
|
||||||
use-chips
|
use-chips
|
||||||
multiple
|
multiple
|
||||||
@ -181,6 +183,8 @@
|
|||||||
@new-value="tagVerify"
|
@new-value="tagVerify"
|
||||||
input-debounce="0"
|
input-debounce="0"
|
||||||
:options="allQuickCommandTags"
|
:options="allQuickCommandTags"
|
||||||
|
ref="commandTagRef"
|
||||||
|
@blur="(e) => autoAddInputVal(e, $refs.commandTagRef)"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon color="primary" name="label" />
|
<q-icon color="primary" name="label" />
|
||||||
@ -445,6 +449,11 @@ export default {
|
|||||||
)
|
)
|
||||||
this.cmdMatch = `/${this.cmdMatch}/`;
|
this.cmdMatch = `/${this.cmdMatch}/`;
|
||||||
},
|
},
|
||||||
|
autoAddInputVal(e, ref) {
|
||||||
|
let inputValue = e.target.value;
|
||||||
|
if (!inputValue) return;
|
||||||
|
ref.add(inputValue, true);
|
||||||
|
},
|
||||||
insertSpecialVar(text) {
|
insertSpecialVar(text) {
|
||||||
if (!text) return;
|
if (!text) return;
|
||||||
this.$parent.$refs.editor.repacleEditorSelection(`'${text}'`);
|
this.$parent.$refs.editor.repacleEditorSelection(`'${text}'`);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user