| | |
| | | const NormalForm = asyncComponent(() => import('@/menu/components/form/normal-form')) |
| | | const NormalGroup = asyncComponent(() => import('@/menu/components/group/normal-group')) |
| | | const CodeSandbox = asyncComponent(() => import('@/menu/components/code/sandbox')) |
| | | const NormalLogin = asyncComponent(() => import('@/pc/components/login/normal-login')) |
| | | |
| | | const Card = ({ id, card, moveCard, findCard, delCard, updateConfig }) => { |
| | | const originalIndex = findCard(id).index |
| | |
| | | return (<NormalGroup group={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'code') { |
| | | return (<CodeSandbox card={card} updateConfig={updateConfig} deletecomponent={delCard}/>) |
| | | } else if (card.type === 'login') { |
| | | let height = '' |
| | | if (card.wrap && card.wrap.height) { |
| | | height = card.wrap.height.replace(/\d+vw/ig, (word) => { |
| | | return parseFloat(word) * 350 / 100 + 'px' |
| | | }).replace(/\d+vh/ig, (word) => { |
| | | return parseFloat(word) * 615 / 100 + 'px' |
| | | }) |
| | | } |
| | | |
| | | return (<> |
| | | <NormalLogin card={card} updateConfig={updateConfig} deletecomponent={delCard}/> |
| | | <div style={{float: 'right', height}}></div> |
| | | </>) |
| | | } |
| | | } |
| | | return ( |