From 7378398da68555e657a524cd8482b842f259f252 Mon Sep 17 00:00:00 2001 From: rex Date: Tue, 22 Dec 2020 20:45:52 +0800 Subject: [PATCH] perf(loading): use wxs (#3892) --- packages/loading/index.wxml | 7 ++++--- packages/loading/index.wxs | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 packages/loading/index.wxs diff --git a/packages/loading/index.wxml b/packages/loading/index.wxml index e934288b..7d4a5397 100644 --- a/packages/loading/index.wxml +++ b/packages/loading/index.wxml @@ -1,9 +1,10 @@ + - + - + diff --git a/packages/loading/index.wxs b/packages/loading/index.wxs new file mode 100644 index 00000000..02a0b800 --- /dev/null +++ b/packages/loading/index.wxs @@ -0,0 +1,22 @@ +/* eslint-disable */ +var style = require('../wxs/style.wxs'); +var addUnit = require('../wxs/add-unit.wxs'); + +function spinnerStyle(data) { + return style({ + color: data.color, + width: addUnit(data.size), + height: addUnit(data.size), + }); +} + +function textStyle(data) { + return style({ + 'font-size': addUnit(data.textSize), + }); +} + +module.exports = { + spinnerStyle: spinnerStyle, + textStyle: textStyle, +};