提交 e215bd2a 编写于 作者: 辛宝Otto's avatar 辛宝Otto 🥊

fix: 修正 createImage 名称

上级 d2e68d04
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
<text id="testToDataURLResult">{{testToDataURLResult}}</text> <text id="testToDataURLResult">{{testToDataURLResult}}</text>
</view> </view>
<view class="text-group"> <view class="text-group">
<text>测试 createImage 结果:</text> <text>测试 createImage 结果:</text>
<text id="testCreateImage">{{testCreateImage}}</text> <text id="testCreateImage">{{testCreateImage}}</text>
</view> </view>
<!-- #ifdef WEB --> <!-- #ifdef WEB -->
<button class="canvas-drawing-button" @click="canvasToBlob">canvasToBlob</button> <button class="canvas-drawing-button" @click="canvasToBlob">canvasToBlob</button>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<text>canvasToDataURL:</text> <text>canvasToDataURL:</text>
<text>{{dataBase64.slice(0,22)}}...</text> <text>{{dataBase64.slice(0,22)}}...</text>
</view> </view>
<button @click="drawImageAPI">drawImage</button> <button @click="drawImageAPI">createImage</button>
<view style="padding: 8px 10px;">CanvasContext API 演示</view> <view style="padding: 8px 10px;">CanvasContext API 演示</view>
<view class="grid-view"> <view class="grid-view">
<view class="grid-item" v-for="(name, index) in names" :key="index"> <view class="grid-item" v-for="(name, index) in names" :key="index">
...@@ -100,7 +100,6 @@ ...@@ -100,7 +100,6 @@
success: (res : CanvasContext) => { success: (res : CanvasContext) => {
this.context = res.getContext('2d'); this.context = res.getContext('2d');
this.clearCanvasRect() this.clearCanvasRect()
// hidpi(this.context.canvas);
let image = res.createImage(); let image = res.createImage();
image.src = "../../static/logo.png" image.src = "../../static/logo.png"
image.onload = () => { image.onload = () => {
...@@ -111,7 +110,7 @@ ...@@ -111,7 +110,7 @@
fail: (err : UniError) => { fail: (err : UniError) => {
console.log(err); console.log(err);
} }
} as CreateCanvasContextAsyncOptions) })
}, },
useAsync() { useAsync() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册