init
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
._dflex button {
|
||||
margin: 10px 0;
|
||||
background-color: red;
|
||||
color: white;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
Page({
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
title: 'arrayBuffer2base64/base642ArrayBuffer',
|
||||
path: 'api-case/base64arraybuffer/base64arraybuffer',
|
||||
};
|
||||
},
|
||||
|
||||
data: {
|
||||
value: '',
|
||||
content: [],
|
||||
},
|
||||
|
||||
handleInput(e) {
|
||||
this.setData({ value: e.detail.value });
|
||||
},
|
||||
|
||||
handleArrayBufferToBase64() {
|
||||
const base64 = xhs.arrayBufferToBase64(this.data.content);
|
||||
console.log(base64);
|
||||
this.setData({ content: base64 });
|
||||
},
|
||||
|
||||
handleBase64ToArrayBuffer() {
|
||||
const arrayBuffer = xhs.base64ToArrayBuffer(this.data.value);
|
||||
this.setData({ content: arrayBuffer });
|
||||
console.log(arrayBuffer);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "arrayBufferToBase64",
|
||||
"usingComponents": {
|
||||
"showbox": "../../common/component/showbox/index",
|
||||
"box": "../../common/component/container/index"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<view class="container">
|
||||
<showbox title="arrayBufferToBase64">
|
||||
<box>
|
||||
<view>
|
||||
<view>结果:{{content}}</view>
|
||||
<input class="input" placeholder="base64String" type="text" bindinput="handleInput"></input>
|
||||
<view class="_dflex _fd_column">
|
||||
<button bindtap="handleBase64ToArrayBuffer">base64ToArrayBuffer</button>
|
||||
<button bindtap="handleArrayBufferToBase64">arrayBufferToBase64</button>
|
||||
</view>
|
||||
</view>
|
||||
</box>
|
||||
</showbox>
|
||||
</view>
|
||||
Reference in New Issue
Block a user