diff --git a/annotation-setting.yaml b/annotation-setting.yaml index 76c355b..5fabf6c 100644 --- a/annotation-setting.yaml +++ b/annotation-setting.yaml @@ -147,3 +147,23 @@ spec: label: 关闭 - value: "" label: 跟随默认配置 + +--- + +apiVersion: v1alpha1 +kind: AnnotationSetting +metadata: + generateName: annotation-setting- +spec: + targetRef: + group: "" + kind: MenuItem + formSchema: + - $formkit: "text" + name: "icon" + label: "图标" + placeholder: '请输入菜单图标,支持Remix V3.5.0' + - $formkit: "text" + name: "desc" + label: "描述" + placeholder: '请输入鼠标悬停时描述内容,默认为菜单名' diff --git a/templates/common/navbar.html b/templates/common/navbar.html index 48f1f38..3d909ca 100644 --- a/templates/common/navbar.html +++ b/templates/common/navbar.html @@ -15,7 +15,8 @@ class="item" th:href="${menuItem.status.href}" th:target="${menuItem.spec.target?.value}" - th:title="${#annotations.getOrDefault(menuItem, 'desc', menuItem.status.displayName)}"> + th:with="desc = ${#annotations.getOrDefault(menuItem, 'desc', menuItem.status.displayName)}" + th:title="${#strings.isEmpty(desc) ? menuItem.status.displayName : desc}"> [[${menuItem.status.displayName}]] @@ -25,7 +26,8 @@ + th:with="desc = ${#annotations.getOrDefault(menuItem, 'desc', menuItem.status.displayName)}" + th:title="${#strings.isEmpty(desc) ? menuItem.status.displayName : desc}"> [[${menuItem.status.displayName}]] @@ -37,7 +39,8 @@ + th:with="desc = ${#annotations.getOrDefault(dropdown, 'desc', dropdown.status.displayName)}" + th:title="${#strings.isEmpty(desc) ? dropdown.status.displayName : desc}"> [[${dropdown.status.displayName}]] @@ -47,7 +50,8 @@ + th:with="desc = ${#annotations.getOrDefault(dropdownChild, 'desc', dropdownChild.status.displayName)}" + th:title="${#strings.isEmpty(desc) ? dropdownChild.status.displayName : desc}"> [[${dropdownChild.status.displayName}]]