Skip to content

引入组件

局部引入

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

基础用法

html
<f-popup v-model="showPopup" position="bottom">
  <template #closeIcon>
    <image src="/static/icons/icon_close.png" class="w-[44rpx] h-[44rpx]"></image>
  </template>
  <view class="px-[32rpx] py-[64rpx] text-center">这里是弹框显示内容</view>
</f-popup>
<f-button width="200rpx" margin="200rpx auto" @click="showPopup = true">click</f-button>
ts
import { ref } from 'vue'
const showPopup = ref<boolean>(false)

插槽

名称说明
default弹出层展示的内容
closeIcon弹出层关闭图标

属性

名称类型说明默认值
v-modelboolean是否显示弹出层-
positionstring弹出层位置,可传入[topbottom]-
isMaskboolean是否显示遮罩层true
closeOnClickMaskboolean是否点击遮罩层关闭键盘true
isAnimateboolean是否显示动画true
borderRadiusstring自定义圆角大小16rpx
bgColorstring自定义弹框背景颜色#FFFFFF
zIndexnumber自定义弹框 z-index12000

事件

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

方法

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