import { View, Text } from '@tarojs/components'
import './Modal.scss'
import React from 'react';
import { ModalType } from '@/utils/types';
import Box from './Box';
export default function Modal(props: {
children: React.ReactNode,
testInfo?: React.ReactNode,
title?: string, dismiss: Function,
confirm: Function,
themeColor?: string,
modalType?: ModalType
}) {
//阻止中间内容点击事件穿透
function click(e) {
e.stopPropagation();
}
switch (props.modalType) {
case ModalType.center:
return props.dismiss()}>
{
props.children
}
}
return
props.dismiss()}>
{
props.testInfo ? props.testInfo : null
}
{/* {props.title ? props.title : '测试标题 '} */}
{
props.children
}
{/*
props.dismiss()}>
取消
props.confirm()}>
确定
*/}
}