12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- /* eslint-disable */
- var style = require('../wxs/style.wxs');
- var addUnit = require('../wxs/add-unit.wxs');
- function isImage(name) {
- return name.indexOf('/') !== -1;
- }
- function rootClass(data) {
- var classes = ['custom-class'];
- if (data.classPrefix != null) {
- classes.push(data.classPrefix);
- }
- if (data.classPrefix !== 'van-icon') {
- classes.push('van-icon')
- }
- if (isImage(data.name)) {
- classes.push('van-icon--image');
- } else if (data.classPrefix != null) {
- classes.push(data.classPrefix + '-' + data.name);
- }
- return classes.join(' ');
- }
- function rootStyle(data) {
- return style([
- {
- color: data.color,
- 'font-size': addUnit(data.size),
- },
- data.customStyle,
- ]);
- }
- module.exports = {
- isImage: isImage,
- rootClass: rootClass,
- rootStyle: rootStyle,
- };
|