From 0c3383a6c5393169d801b4b03f01a355c840d159 Mon Sep 17 00:00:00 2001 From: rex Date: Tue, 22 Dec 2020 20:28:29 +0800 Subject: [PATCH] perf(cell): use wxs (#3888) --- packages/cell/index.wxml | 3 ++- packages/cell/index.wxs | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 packages/cell/index.wxs diff --git a/packages/cell/index.wxml b/packages/cell/index.wxml index fed768e2..7d7d746d 100644 --- a/packages/cell/index.wxml +++ b/packages/cell/index.wxml @@ -1,4 +1,5 @@ + {{ title }} diff --git a/packages/cell/index.wxs b/packages/cell/index.wxs new file mode 100644 index 00000000..e3500c43 --- /dev/null +++ b/packages/cell/index.wxs @@ -0,0 +1,17 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function titleStyle(data) { + return style([ + { + 'max-width': addUnit(data.titleWidth), + 'min-width': addUnit(data.titleWidth), + }, + data.titleStyle, + ]); +} + +module.exports = { + titleStyle: titleStyle, +};