mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-12-20 19:20:37 +08:00
可视化编排的命令卡片支持禁用,复制,快速打印
This commit is contained in:
@@ -104,7 +104,6 @@ export const imageCommands = {
|
||||
width: 6,
|
||||
min: 1,
|
||||
step: 10,
|
||||
defaultValue: "",
|
||||
},
|
||||
{
|
||||
label: "高度(像素)",
|
||||
@@ -113,7 +112,6 @@ export const imageCommands = {
|
||||
width: 6,
|
||||
min: 1,
|
||||
step: 10,
|
||||
defaultValue: "",
|
||||
},
|
||||
{
|
||||
label: "保持宽高比",
|
||||
|
||||
@@ -172,11 +172,12 @@ const customComponentGuide = {
|
||||
description: "组件初始化时的处理",
|
||||
implementation: `
|
||||
// 如果没有 argvs 和 code,使用默认值初始化
|
||||
if (!this.modelValue.argvs && !this.modelValue.code) {
|
||||
const argvs = this.modelValue.argvs || this.defaultArgvs;
|
||||
if (!this.modelValue.code) {
|
||||
this.$emit("update:modelValue", {
|
||||
...this.modelValue,
|
||||
argvs: this.defaultArgvs,
|
||||
code: this.generateCode(this.defaultArgvs)
|
||||
argvs,
|
||||
code: this.generateCode(argvs),
|
||||
});
|
||||
}
|
||||
`,
|
||||
|
||||
@@ -6,6 +6,8 @@ export function generateCode(commandFlow) {
|
||||
const indent = hasAsyncFunction ? " " : "";
|
||||
|
||||
commandFlow.forEach((cmd) => {
|
||||
// 跳过禁用的命令
|
||||
if (cmd.disabled) return;
|
||||
if (!cmd.code) return;
|
||||
let line = indent;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user