feat: less completions
This commit is contained in:
@@ -28,12 +28,13 @@ export const trackCommand: MdCommanderCommand = {
|
||||
// 直接添加追踪项目
|
||||
addTrackerItem(parsed);
|
||||
|
||||
const idStr = parsed.id ? ` #${parsed.id}` : "";
|
||||
const classStr = parsed.classes.length > 0 ? `.${parsed.classes.join(".")}` : "";
|
||||
const attrCount = Object.keys(parsed.attributes).length;
|
||||
const attrStr = attrCount > 0 ? `[${attrCount} 个属性]` : "";
|
||||
|
||||
return {
|
||||
message: `已添加追踪项目:${parsed.tag}${classStr}${attrStr}`,
|
||||
message: `已添加追踪项目:${parsed.tag}${idStr}${classStr}${attrStr}`,
|
||||
type: "success",
|
||||
};
|
||||
},
|
||||
@@ -71,7 +72,7 @@ export const listTrackCommand: MdCommanderCommand = {
|
||||
return { message: "暂无追踪项目", type: "info" };
|
||||
}
|
||||
|
||||
const list = items.map((i) => `${i.tag}${i.classes.length > 0 ? "." + i.classes.join(".") : ""}`).join("\n");
|
||||
const list = items.map((i) => `${i.tag}${i.id ? "#" + i.id : ""}${i.classes.length > 0 ? "." + i.classes.join(".") : ""}`).join("\n");
|
||||
return { message: `追踪项目:\n${list}`, type: "info" };
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user