Skip to content

Commit

Permalink
Feat: 1.4.0 & update to [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
Miaonster committed Jun 17, 2019
1 parent 795d3c4 commit 74f3ca6
Show file tree
Hide file tree
Showing 5 changed files with 220 additions and 161 deletions.
3 changes: 3 additions & 0 deletions config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ const config = {
'transform-class-properties',
'transform-object-rest-spread'
]
},
uglify: {
enable: true,
}
},
defineConstants: {
Expand Down
108 changes: 55 additions & 53 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,57 @@
{
"name": "taro-code",
"version": "1.3.1",
"description": "Taro.js barcode & qrcode",
"scripts": {
"build": "export TARO_BUILD_TYPE=ui && taro build --ui",
"build:weapp": "taro build --type weapp",
"build:swan": "taro build --type swan",
"build:alipay": "taro build --type alipay",
"build:tt": "taro build --type tt",
"build:h5": "taro build --type h5",
"build:rn": "taro build --type rn",
"dev:weapp": "npm run build:weapp -- --watch",
"dev:swan": "npm run build:swan -- --watch",
"dev:alipay": "npm run build:alipay -- --watch",
"dev:tt": "npm run build:tt -- --watch",
"dev:h5": "npm run build:h5 -- --watch",
"dev:rn": "npm run build:rn -- --watch"
},
"author": "Miaonster <[email protected]>",
"license": "MIT",
"files": ["dist"],
"main": "dist/index.js",
"dependencies": {
"@tarojs/components": "1.2.26",
"@tarojs/router": "1.2.26",
"@tarojs/taro": "1.2.26",
"@tarojs/taro-alipay": "1.2.26",
"@tarojs/taro-h5": "1.2.26",
"@tarojs/taro-swan": "1.2.26",
"@tarojs/taro-tt": "1.2.26",
"@tarojs/taro-weapp": "1.2.26",
"nervjs": "^1.3.9",
"nerv-devtools": "^1.3.9"
},
"devDependencies": {
"@types/react": "^16.4.6",
"@types/webpack-env": "^1.13.6",
"@tarojs/plugin-babel": "1.2.26",
"@tarojs/plugin-csso": "1.2.26",
"@tarojs/plugin-uglifyjs": "1.2.26",
"@tarojs/webpack-runner": "1.2.26",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-jsx-stylesheet": "^0.6.5",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-eslint": "^8.2.3",
"eslint": "^4.19.1",
"eslint-config-taro": "1.2.26",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-taro": "1.2.26"
}
"name": "taro-code",
"version": "1.4.0",
"description": "Taro.js barcode & qrcode",
"scripts": {
"build": "export TARO_BUILD_TYPE=ui && taro build --ui",
"build:weapp": "taro build --type weapp",
"build:swan": "taro build --type swan",
"build:alipay": "taro build --type alipay",
"build:tt": "taro build --type tt",
"build:h5": "taro build --type h5",
"build:rn": "taro build --type rn",
"dev:weapp": "npm run build:weapp -- --watch",
"dev:swan": "npm run build:swan -- --watch",
"dev:alipay": "npm run build:alipay -- --watch",
"dev:tt": "npm run build:tt -- --watch",
"dev:h5": "npm run build:h5 -- --watch",
"dev:rn": "npm run build:rn -- --watch"
},
"author": "Miaonster <[email protected]>",
"license": "MIT",
"files": [
"dist"
],
"main": "dist/index.js",
"dependencies": {
"@tarojs/components": "1.3.1",
"@tarojs/router": "1.3.1",
"@tarojs/taro": "1.3.1",
"@tarojs/taro-alipay": "1.3.1",
"@tarojs/taro-h5": "1.3.1",
"@tarojs/taro-swan": "1.3.1",
"@tarojs/taro-tt": "1.3.1",
"@tarojs/taro-weapp": "1.3.1",
"nervjs": "^1.3.9",
"nerv-devtools": "^1.3.9"
},
"devDependencies": {
"@types/react": "^16.4.6",
"@types/webpack-env": "^1.13.6",
"@tarojs/plugin-babel": "1.3.1",
"@tarojs/plugin-csso": "1.3.1",
"@tarojs/plugin-uglifyjs": "1.3.1",
"@tarojs/webpack-runner": "1.3.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-jsx-stylesheet": "^0.6.5",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-eslint": "^8.2.3",
"eslint": "^4.19.1",
"eslint-config-taro": "1.3.1",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-taro": "1.3.1"
}
}
11 changes: 6 additions & 5 deletions src/components/Barcode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ class Barcode extends Component {
}

render () {
const { width, height } = this.props
const style = {
width: this.props.width * 2 + 'px',
height: this.props.height * 2 + 'px',
width: width * 2 + 'px',
height: height * 2 + 'px',
}

const wrapStyle = {
width: this.props.width + 'px',
height: this.props.height + 'px',
width: width + 'px',
height: height + 'px',
}

return (
Expand All @@ -43,7 +44,7 @@ class Barcode extends Component {
}

Barcode.defaultProps = {
text: 'HELLO',
text: '',
width: 375,
height: 80,
}
Expand Down
11 changes: 6 additions & 5 deletions src/components/Qrcode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,20 @@ class QRCode extends Component {
}

render () {
const { size, text } = this.props
const style = {
width: this.props.size + 'px',
height: this.props.size + 'px',
width: size + 'px',
height: size + 'px',
}

const wrapStyle = {
width: this.props.size + 'px',
height: this.props.size + 'px',
width: size + 'px',
height: size + 'px',
}

return (
<View className='wrap' style={wrapStyle}>
{this.props.text && <Canvas canvasId='qrcode' className='qrcode' style={style}></Canvas>}
{text && <Canvas canvasId='qrcode' className='qrcode' style={style}></Canvas>}
</View>
)
}
Expand Down
Loading

0 comments on commit 74f3ca6

Please sign in to comment.