mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
perf(notice-bar): use wxs (#3891)
This commit is contained in:
parent
97c1a7780d
commit
7df96aeb5d
@ -1,9 +1,10 @@
|
|||||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||||
|
<wxs src="./index.wxs" module="computed" />
|
||||||
|
|
||||||
<view
|
<view
|
||||||
wx:if="{{ show }}"
|
wx:if="{{ show }}"
|
||||||
class="custom-class {{ utils.bem('notice-bar', { withicon: mode, wrapable }) }}"
|
class="custom-class {{ utils.bem('notice-bar', { withicon: mode, wrapable }) }}"
|
||||||
style="color: {{ color }}; background-color: {{ backgroundColor }}; background: {{ background }}"
|
style="{{ computed.rootStyle({ color, backgroundColor, background }) }}"
|
||||||
bind:tap="onClick"
|
bind:tap="onClick"
|
||||||
>
|
>
|
||||||
<van-icon
|
<van-icon
|
||||||
|
15
packages/notice-bar/index.wxs
Normal file
15
packages/notice-bar/index.wxs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
var style = require('../wxs/style.wxs');
|
||||||
|
var addUnit = require('../wxs/add-unit.wxs');
|
||||||
|
|
||||||
|
function rootStyle(data) {
|
||||||
|
return style({
|
||||||
|
color: data.color,
|
||||||
|
'background-color': data.backgroundColor,
|
||||||
|
background: data.background,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
rootStyle: rootStyle,
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user