This commit is contained in:
2025-09-14 00:21:54 +08:00
commit d40b3bbd62
766 changed files with 36275 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
._dflex button {
margin: 10px 0;
background-color: red;
color: white;
}

View File

@@ -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);
},
});

View File

@@ -0,0 +1,7 @@
{
"navigationBarTitleText": "arrayBufferToBase64",
"usingComponents": {
"showbox": "../../common/component/showbox/index",
"box": "../../common/component/container/index"
}
}

View File

@@ -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>