From 574fa190853bbe7c0ed4ab892ec644d4dd2adcdd Mon Sep 17 00:00:00 2001 From: JayBridge <12310903@mail.sustech.edu.cn> Date: Thu, 19 Jun 2025 17:14:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=A0=8F=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A9=BA?= =?UTF-8?q?=E7=99=BD=E6=A0=BC=E6=97=B6=E6=98=BE=E7=A4=BA=E6=A0=BC=E5=8F=B7?= =?UTF-8?q?=E4=B8=BAplaceholder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/edit-bar.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/view/edit-bar.ts b/src/view/edit-bar.ts index a5a1f6c..c184d1c 100644 --- a/src/view/edit-bar.ts +++ b/src/view/edit-bar.ts @@ -1,4 +1,5 @@ import { TableUtils } from "../utils/table-utils"; +import { i18n } from "../i18n"; export interface EditBarOptions { editBarEl: HTMLElement; @@ -22,8 +23,15 @@ export function renderEditBar(options: EditBarOptions) { // 显示单元格地址 const cellAddress = TableUtils.getCellAddress(activeRowIndex, activeColIndex); editBarEl.setAttribute("data-cell-address", cellAddress); + // 如果是空白格,显示格号为placeholder + if (!activeCellEl.value) { + editInput.placeholder = cellAddress; + } else { + editInput.placeholder = ""; + } } else { editInput.value = ""; + editInput.placeholder = i18n.t("editBar.placeholder"); editBarEl.removeAttribute("data-cell-address"); }