Skip to content

Commit

Permalink
🌈 style:代码格式化
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackishGreen33 committed Aug 28, 2024
1 parent 057bdd7 commit 6e31203
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/common/components/iconfont/index.weapp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import React, { FunctionComponent } from 'react';


export type IconNames = 'comment' | 'like' | 'wechat' | 'yanjing' | 'yanjing1' | 'xiaxue';

interface Props {
Expand Down
16 changes: 8 additions & 8 deletions src/common/components/iconfont/weapp/weapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ Component({
// string | string[]
color: {
type: null,
observer: function(color) {
observer: function (color) {
this.setData({
colors: this.fixColor(),
isStr: typeof color === 'string',
});
}
},
},
size: {
type: Number,
value: 18,
observer: function(size) {
observer: function (size) {
this.setData({
svgSize: size,
});
Expand All @@ -31,7 +31,7 @@ Component({
isStr: true,
},
methods: {
fixColor: function() {
fixColor: function () {
var color = this.data.color;
var hex2rgb = this.hex2rgb;

Expand All @@ -43,7 +43,7 @@ Component({
return item.indexOf('#') === 0 ? hex2rgb(item) : item;
});
},
hex2rgb: function(hex) {
hex2rgb: function (hex) {
var rgb = [];

hex = hex.substr(1);
Expand All @@ -52,12 +52,12 @@ Component({
hex = hex.replace(/(.)/g, '$1$1');
}

hex.replace(/../g, function(color) {
hex.replace(/../g, function (color) {
rgb.push(parseInt(color, 0x10));
return color;
});

return 'rgb(' + rgb.join(',') + ')';
}
}
},
},
});

0 comments on commit 6e31203

Please sign in to comment.