提交 97d365a3 编写于 作者: Q qiang

chore: lint

上级 f8bfec19
import {
hasOwn
}
from 'uni-shared'
from 'uni-shared'
export const pixelRatio = (function () {
const canvas = document.createElement('canvas')
......
import {
noop
}
from 'uni-shared'
from 'uni-shared'
const sharedPropertyDefinition = {
enumerable: true,
......
......@@ -14,7 +14,7 @@ import {
import {
lifecycleMixin
}
from 'uni-core/service/plugins/lifecycle'
from 'uni-core/service/plugins/lifecycle'
import {
VD_SYNC_VERSION
......@@ -23,7 +23,7 @@ import {
import {
ON_REACH_BOTTOM_DISTANCE
}
from '../../constants'
from '../../constants'
import {
NAVBAR_HEIGHT
......
......@@ -9,7 +9,7 @@ import {
getApp,
getCurrentPages
}
from 'uni-core/service/plugins/app'
from 'uni-core/service/plugins/app'
initOn(UniServiceJSBridge.on, {
getApp,
......
......@@ -8,14 +8,14 @@
a: number;
}
*/
export function hexToRgba(hex) {
export function hexToRgba (hex) {
// 异常情况
if (!hex) {
return {
r: 0,
g: 0,
b: 0,
a: 0,
a: 0
}
}
// 去掉 #
......@@ -27,7 +27,7 @@ export function hexToRgba(hex) {
r: 0,
g: 0,
b: 0,
a: 0,
a: 0
}
}
// 格式化 tmpHex,使其变成 rrggbb 或 rrggbbaa
......@@ -36,9 +36,9 @@ export function hexToRgba(hex) {
tmpHex = tmpHex.replace(/(\w{1})/g, '$1$1')
}
// rgba
let [sr, sg, sb, sa] = tmpHex.match(/(\w{2})/g)
const [sr, sg, sb, sa] = tmpHex.match(/(\w{2})/g)
// rgb
const r = parseInt(sr, 16), g = parseInt(sg, 16), b = parseInt(sb, 16)
const r = parseInt(sr, 16); const g = parseInt(sg, 16); const b = parseInt(sb, 16)
if (!sa) {
return { r, g, b, a: 1 }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册