From f1adaac34060098c9b355e4be3f3e4fc5887d3d8 Mon Sep 17 00:00:00 2001 From: liaoxuezhi Date: Wed, 3 Jul 2019 14:37:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4=E7=9A=84?= =?UTF-8?q?=20itemSchema?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Carousel.tsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/renderers/Carousel.tsx b/src/renderers/Carousel.tsx index 4e3eeaa2..acc61912 100644 --- a/src/renderers/Carousel.tsx +++ b/src/renderers/Carousel.tsx @@ -38,6 +38,15 @@ const defaultSchema = { type: 'tpl', tpl: ` <% if (data.hasOwnProperty('image')) { %> +
+ <% if (data.hasOwnProperty('title')) { %> +
<%= data.title %>
+ <% } if (data.hasOwnProperty('description')) { %> +
<%= data.description %>
+ <% } %> + <% } else if (data.hasOwnProperty('html')) { %> + <%= data.html %>" + <% } else if (data.hasOwnProperty('image')) { %>
<% if (data.title) { %>
<%= data.title %>
@@ -45,17 +54,8 @@ const defaultSchema = {
<%= data.description %>
<% } %> <% } else if (data.hasOwnProperty('html')) { %> - <%= data.html %>" - <% } else if (data.image) { %> -
- <% if (data.title) { %> -
<%= data.title %>
- <% } if (data.description) { %> -
<%= data.description %>
- <% } %> - <% } else if (data.html) { %> <%= data.html %> - <% } else if (data.item) { %> + <% } else if (data.hasOwnproperty('item')) { %> <%= data.item %> <% } else { %> <%= '未找到渲染数据' %>