chore: initialize qiming workspace repository
This commit is contained in:
18
qiming-mobile/uni_modules/x-tools/tools/com.js
Normal file
18
qiming-mobile/uni_modules/x-tools/tools/com.js
Normal file
@@ -0,0 +1,18 @@
|
||||
export const commonProps = {
|
||||
bgColor: {
|
||||
type: String,
|
||||
default: '#fff'
|
||||
},
|
||||
customStyle: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
}
|
||||
|
||||
export const str2px = str => {
|
||||
if (!str) return 0
|
||||
str = String(str)
|
||||
if (str.endsWith('rpx')) return uni.upx2px(parseInt(str))
|
||||
if (str.endsWith('px')) return parseInt(str)
|
||||
return parseInt(str)
|
||||
}
|
||||
Reference in New Issue
Block a user