diff --git a/src/components/composer/common/VariableInput.vue b/src/components/composer/common/VariableInput.vue index da9071a..18f7224 100644 --- a/src/components/composer/common/VariableInput.vue +++ b/src/components/composer/common/VariableInput.vue @@ -33,6 +33,12 @@ @emit-value="updateValBySelect" class="prepend-btn" /> + + } [options.items] - 选项数组,每项可以是字符串或对象 + * @property {String} [options.items[].label] - 选项显示文本(当选项为对象时) + * @property {String} [options.items[].value] - 选项值(当选项为对象时) + * @property {Boolean} [options.multiSelect] - 是否支持多选 + * @property {Boolean} [options.appendItem] - 是否将选中项追加到现有值后 + * * @property {Object} [options.dialog] - 文件选择对话框配置 - * @property {String} [options.dialog.type] - 对话框类型,open 或 save - * @property {Object} [options.dialog.options] - 对话框选项,对应 utools.showOpenDialog 和 utools.showSaveDialog 的 options + * @property {String} [options.dialog.type] - 对话框类型: 'open' 或 'save' + * @property {Object} [options.dialog.options] - utools 对话框选项 + * @property {String} [options.dialog.options.title] - 对话框标题 + * @property {String} [options.dialog.options.defaultPath] - 默认路径 + * @property {Array} [options.dialog.options.properties] - 对话框属性,如 ['openFile', 'multiSelections'] + * + * @property {Object} [options.cssSelector] - CSS选择器配置 + * @property {Boolean} [options.cssSelector] - 设置为 true 启用CSS选择器功能 + * + * @property {Object} [options.window] - 窗口选择器配置 + * @property {Object} [options.window.props] - 要获取的窗口属性 + * @property {Array} [options.window.props] - 属性列表,每项包含label和value + * @property {String} [options.window.props[].label] - 属性显示名称 + * @property {String} [options.window.props[].value] - 属性访问路径,如 'bounds.x' + * * @example - * // modelValue 对象格式 - * { - * value: "", // 输入框的值 - * isString: true, // 是否是字符串 - * __varInputVal__: true // 用于标识是变量输入框 - * } + * // 基础用法 + * + * * @example - * // options 对象格式 - * { - * items: ["item1", "item2", "item3"], // 选项列表 - * dialog: { - * type: "open", // 对话框类型,open 或 save - * options: { - * title: "选择文件", - * defaultPath: "/", - * }, - * }, - * } + * // 带选项列表的输入框 + * + * + * @example + * // 文件选择输入框 + * + * + * @example + * // CSS选择器输入框 + * + * + * @example + * // 窗口选择器输入框 + * */ export default defineComponent({ name: "VariableInput", @@ -103,6 +165,7 @@ export default defineComponent({ FileSelector, VariableList, WindowSelector, + CssSelector, }, props: { diff --git a/src/components/composer/common/varinput/CssSelector.vue b/src/components/composer/common/varinput/CssSelector.vue new file mode 100644 index 0000000..0b5db1b --- /dev/null +++ b/src/components/composer/common/varinput/CssSelector.vue @@ -0,0 +1,22 @@ + + + diff --git a/src/components/composer/common/varinput/WindowSelector.vue b/src/components/composer/common/varinput/WindowSelector.vue index 89d3d46..6e3293a 100644 --- a/src/components/composer/common/varinput/WindowSelector.vue +++ b/src/components/composer/common/varinput/WindowSelector.vue @@ -1,5 +1,14 @@