修复select组件不允许默认选择空值项的问题

This commit is contained in:
j m 2024-09-07 07:51:02 +08:00
parent 00e0ae896b
commit a7f01cdcff
2 changed files with 9 additions and 9 deletions

View File

@ -22,22 +22,22 @@ spec:
- $formkit: select
name: thumbnail_mode
label: 文章列表缩略图模式
value: ""
value: "none"
help: '文章在列表的缩略图模式,除网格布局外,当前配置将覆盖主题中的默认配置。'
options:
- value: default
- value: "default"
label: 默认模式
- value: back
- value: "back"
label: 背景图模式
- value: small
- value: "small"
label: 小图模式(左侧)
- value: small-right
- value: "small-right"
label: 小图模式(右侧)
- value: small-alter
- value: "small-alter"
label: 小图模式(交替)
- value: fold
- value: "fold"
label: 折叠模式
- value: ""
- value: "none"
label: 跟随默认配置
- $formkit: text
name: tips

View File

@ -2,7 +2,7 @@
th:fragment="articleList (posts)">
<th:block th:each="post : ${posts}"
th:with="thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + (#strings.contains(theme.config.post.default_thumbnail, '?') ? '&' : '?') + 'id=' + post.metadata.name : thumbnail.gen(post.spec.cover, 's')},
thumbnail_mode = ${(theme.config.post.top_thumbnail_mode == 'grid' || (!post.spec.pinned && theme.config.post.thumbnail_mode == 'grid'))? 'grid' : !#strings.isEmpty(post.metadata.annotations.get('thumbnail_mode'))? post.metadata.annotations.get('thumbnail_mode') : post.spec.pinned ? theme.config.post.top_thumbnail_mode : theme.config.post.thumbnail_mode}">
thumbnail_mode = ${(theme.config.post.top_thumbnail_mode == 'grid' || (!post.spec.pinned && theme.config.post.thumbnail_mode == 'grid'))? 'grid' : (!#strings.isEmpty(post.metadata.annotations.get('thumbnail_mode')) && post.metadata.annotations.get('thumbnail_mode') != 'none')? post.metadata.annotations.get('thumbnail_mode') : post.spec.pinned ? theme.config.post.top_thumbnail_mode : theme.config.post.thumbnail_mode}">
<div th:if="${!#strings.isEmpty(thumbnail) && thumbnail_mode == 'back'}" class="card widget card-cover">
<a th:href="${post.status.permalink}">
<div class="cover-image" th:style="'background-image: url(' + ${thumbnail} + ')'"></div>