先看效果图,一种是固定在右下角的圆形按钮,一种是固定底部的提交按钮。
实现
首先引入 colorUI,参考:
https://blog.csdn.net/weixin_43930421/article/details/124748879
在 components 文件目录下新建 floatBtn 组件
floatBtn.axml
<view class="btn-position-{
{position}}">
<!-- -->
<block a:if="{
{position=='bottom'}}">
<button class="bg-{
{color}} round margin-left margin-right" onTap="handleTap">
<slot name="text">
提 交
</slot