实现场景:
请问以下功能如何实现,在此先谢过各位大神:)
点击“复制”按钮后 ,自动将当前选中的tab的body里的HTML内容复制到剪贴板。
例如:
1.当前tab的“收入“选中的时候,点击复制按钮后,剪贴板里面得到 “金额:199元”,
2.当前tab的“支出“选中的时候,点击复制按钮后,剪贴板里面得到 “金额:299元”。
存在的问题:
请简单描述你现在遇到的不符合预期的问题...
当前方案:
请粘贴你当前方案的完整 amis schema 代码...
<link href="https://cdn.bootcdn.net/ajax/libs/amis/2.3.0/sdk.min.css" rel="stylesheet">
<script src="https://cdn.bootcdn.net/ajax/libs/amis/2.3.0/sdk.min.js"></script>
<div id="root" class="app-wrapper"></div>
<script type="text/javascript">
(function () {
let amis = amisRequire('amis/embed');
let amisJSON = {
"type": "page",
"data": {
"arr": [
{
"a": "收入",
"b": 199
},
{
"a": "支出",
"b": 299
}
]
},
"body": [
{
"type": "tabs",
"source": "${arr}",
"tabs": [
{
"title": "${a}",
"body": {
"type": "tpl",
"tpl": "金额:${b|number}元"
}
}
]
},
{
"type": "operation",
"label": "操作",
"buttons": [
{
"label": "复制",
"type": "button",
}
]
}
]
};
let amisScoped = amis.embed('#root', amisJSON);
})();
</script>
1条答案
按热度按时间js5cn81o1#
👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.
Please review the labels and make any necessary changes.