上传代码

This commit is contained in:
2025-08-18 14:20:34 +08:00
commit 527fd07910
2408 changed files with 427370 additions and 0 deletions

View File

@ -0,0 +1,43 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
__name: "vegetables",
setup(__props) {
const textToCopy = common_vendor.ref("这是要复制的文本");
const copyText = async () => {
try {
await common_vendor.index.setClipboardData({
data: textToCopy.value,
success: () => {
common_vendor.index.showToast({
title: "复制成功",
icon: "success",
duration: 2e3
});
},
fail: (err) => {
common_vendor.index.showToast({
title: "复制失败",
icon: "none",
duration: 2e3
});
}
});
} catch (error) {
console.error("复制失败:", error);
common_vendor.index.showToast({
title: "复制失败",
icon: "none",
duration: 2e3
});
}
};
return (_ctx, _cache) => {
return {
a: common_vendor.t(textToCopy.value),
b: common_vendor.o(copyText)
};
};
}
};
wx.createPage(_sfc_main);

View File

@ -0,0 +1,6 @@
{
"navigationBarTitleText": "各种蔬菜",
"navigationBarBackgroundColor": "#4095e5",
"enablePullDownRefresh": false,
"usingComponents": {}
}

View File

@ -0,0 +1 @@
<view><view class="content"><view class="text-to-copy" id="copy-text">{{a}}</view><button bindtap="{{b}}">复制文本</button></view></view>

View File

@ -0,0 +1,11 @@
.content {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
}
.text-to-copy {
font-size: 16px;
margin-bottom: 10px;
}