jeawin-astro 4.0.13 → 4.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jeawin-astro",
3
- "version": "4.0.13",
3
+ "version": "4.0.15",
4
4
  "author": "chaegumi <chaegumi@qq.com>",
5
5
  "description": "Astro components for Jeawin CMS",
6
6
  "license": "MIT",
@@ -260,7 +260,7 @@ if(num > 1){
260
260
  ) : (
261
261
  <div class="content-wrapper border border-white p-1 h-full cursor-pointer overflow-hidden flex items-center justify-center relative">
262
262
  <div class="relative magnifier w-full h-full">
263
- <JeawinImage img_html={img_change_attrs(nodepics[0], {style:'width:100%;height:100%;'}, {})} add_classes="w-full h-full" />
263
+ <JeawinImage img_html={img_change_attrs(nodepics[0], {style:'width:100%;height:100%;'}, {})} add_classes="w-full h-full" loading="eager" />
264
264
  </div>
265
265
 
266
266
  </div>
@@ -98,11 +98,15 @@ export function render_date(locale = 'en', t, f = 'MMM DD, YYYY') {
98
98
  * 安全输出数据
99
99
  */
100
100
  export function render_value(obj, prop, def = '') {
101
- const propValue = _.get(obj, prop, def);
102
- if (_.isString(propValue)) {
103
- return _.replace(propValue, '{{YEAR}}', dayjs().format('YYYY'));
101
+ const propValue = _.get(obj, prop);
102
+ let returnValue = propValue;
103
+ if (returnValue === null || returnValue === undefined || returnValue === '') {
104
+ returnValue = def;
104
105
  }
105
- return propValue;
106
+ if (_.isString(returnValue)) {
107
+ return _.replace(returnValue, '{{YEAR}}', dayjs().format('YYYY'));
108
+ }
109
+ return returnValue;
106
110
  }
107
111
 
108
112
  /**