提交 03982b9a 编写于 作者: 郭胜强

Merge branch 'master' into dev

{ {
"name": "@dcloudio/uni-h5", "name": "@dcloudio/uni-h5",
"version": "0.0.7", "version": "0.0.8",
"description": "uni-app h5", "description": "uni-app h5",
"main": "dist/index.umd.min.js", "main": "dist/index.umd.min.js",
"scripts": { "scripts": {
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
ref="canvas" ref="canvas"
:canvas-id="canvasId" :canvas-id="canvasId"
:disable-scroll="disableScroll" :disable-scroll="disableScroll"
:width="width" width="300"
:height="height" height="150"
@touchmove="_touchmove" @touchmove="_touchmove"
/> />
<v-uni-resize-sensor <v-uni-resize-sensor
initial ref="sensor"
@resize="_resize"/> @resize="_resize"/>
</uni-canvas> </uni-canvas>
</template> </template>
...@@ -39,8 +39,6 @@ export default { ...@@ -39,8 +39,6 @@ export default {
}, },
data () { data () {
return { return {
width: 300,
height: 150,
actionsWaiting: false actionsWaiting: false
} }
}, },
...@@ -53,6 +51,12 @@ export default { ...@@ -53,6 +51,12 @@ export default {
this._actionsDefer = [] this._actionsDefer = []
this._images = {} this._images = {}
}, },
mounted () {
this._resize({
width: this.$refs.sensor.$el.offsetWidth,
height: this.$refs.sensor.$el.offsetHeight
})
},
methods: { methods: {
_handleSubscribe ({ _handleSubscribe ({
type, type,
...@@ -64,8 +68,8 @@ export default { ...@@ -64,8 +68,8 @@ export default {
} }
}, },
_resize ({ width, height }) { _resize ({ width, height }) {
this.width = width this.$refs.canvas.width = width
this.height = height this.$refs.canvas.height = height
}, },
_touchmove (event) { _touchmove (event) {
if (this.disableScroll) { if (this.disableScroll) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册