Skip to content

引入组件

局部引入

ts
// parent.vue
const FModal = defineAsyncComponent(() => import('@/components/formaui/f-modal/f-modal.vue'))

基础用法

html
<f-modal v-model="showModal" is-close-icon title="提示" content="确定退出登录吗?">
  <template #closeIcon>
    <image src="/static/icons/icon_close.png" class="w-[44rpx] h-[44rpx]"></image>
  </template>
  <view class="flex justify-between items-center">
    <f-button width="240rpx" bgColor="#f3f3f3" font-bold shape="round" text-color="var(--f-text-color)" @click="showModal = false">取消</f-button>
    <f-button width="240rpx" bgColor="linear-gradient(90deg, #39a6fe, #1dc7ff)" font-bold shape="round" @click="showModal = false">确定</f-button>
  </view>
</f-modal>
<f-button width="200rpx" margin="200rpx auto" @click="showModal = true">click</f-button>
ts
import { ref } from 'vue'
const showModal = ref<boolean>(false)

插槽

名称说明
default键盘上方展示的内容

属性

名称类型说明默认值
v-modelboolean是否显示弹出框-
titlestring弹出框标题文字-
contentstring弹出框内容文字-
isMaskboolean是否显示遮罩层true
closeOnClickMaskboolean是否点击遮罩层关闭键盘true
isAnimateboolean是否显示动画true
widthstring自定义宽度630rpx
paddingstring自定义内边距40rpx 64rpx
borderRadiusstring自定义圆角大小16rpx
titleSizestring自定义标题文字大小32rpx
titleColorstring自定义标题文字颜色#0B1D4A
contentSizestring自定义内容文字大小28rpx
contentColorstring自定义内容文字颜色#364761
bgColorstring自定义弹框背景颜色#FFFFFF
zIndexnumber自定义弹框 z-index12000

事件

事件名说明回调参数
---

方法

方法名说明传入参数
---