===============
LIBRARY RULES
===============
From library maintainers:
- Use Mix-UI components for mobile-first React applications
- Import components from '@kfe/mix-ui' package
- Follow TypeScript best practices when using components
- Check component API documentation for proper prop usage
### Basic Icon Usage with Mix-UI
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Icons 图标.md
Shows the basic implementation of various icons from '@kfe/mix-ui' in React, categorized by size (24px and 16px). It includes examples like 'ArrowClockwise', 'ArrowDown', 'Alipay', and 'CurrencyBubble'.
```typescript
import React from 'react'
import {
ArrowClockwise24,
ArrowClockwise16,
ArrowDown24,
ArrowDown16,
ArrowSquarePathFill24,
ArrowSquarePathFill16,
Alipay24,
CurrencyBubbleFill24,
BadgeCgFill24
} from '@kfe/mix-ui'
import { DemoBlock } from 'demos'
export default () => {
return (
)
}
```
--------------------------------
### Basic Image Usage with Mix-UI
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Image 图片.md
Demonstrates the fundamental usage of the Mix-UI Image component, displaying a single image with a specified source. This serves as the starting point for integrating the component.
```tsx
import React from 'react'
import { Image } from '@kfe/mix-ui'
import { DemoBlock } from 'demos'
import './style.less'
export default () => {
return (
<>
>
)
}
```
--------------------------------
### CSS Styling for Dialog Component
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Dialog 弹出框.md
Provides CSS examples for customizing the Dialog component's appearance, including global styles for the popup and specific styles for the confirm button.
```css
.dialog {
&:global(.mu-popup) {
background-color: blue;
}
:global(.mu-dialog__confirm) {
background-color: aqua;
color: red;
}
}
```
--------------------------------
### 运行 Mix-UI 文档处理器 (Bash)
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/README.md
用于启动 Mix-UI 文档处理流程的命令。支持基本用法、直接运行和调试模式。
```Bash
pnpm process-mixui
```
```Bash
node dist/index.js mixui
```
```Bash
node dist/index.js mixui --debug
```
--------------------------------
### Tabs with Scrollspy and Sticky Navigation
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Tabs 标签页.md
This example demonstrates how to use the Tabs component with the `scrollspy` and `sticky` properties enabled for a scrollable navigation experience. It includes basic setup and content for multiple tabs.
```tsx
import React from 'react'
import { Tabs } from '@kfe/mix-ui'
import './style.less'
export default () => {
return (
{[1, 2, 3, 4, 5, 6, 7, 8].map(item => (
内容 {item}
))}
)
}
```
--------------------------------
### 开发模式 (Bash)
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/README.md
启动开发模式,通常会启用文件监听和自动重新构建。
```Bash
pnpm dev
```
--------------------------------
### DOMPurify Sanitization Examples
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/RichText 富文本展示.md
Provides several examples demonstrating how DOMPurify sanitizes various types of potentially harmful HTML and JavaScript code, ensuring security.
```js
DOMPurify.sanitize(' '); // becomes
DOMPurify.sanitize(''); // becomes
DOMPurify.sanitize('abc
'); // becomes abc
DOMPurify.sanitize('alert(4)">'); // becomes
DOMPurify.sanitize('HELLO '); // becomes
DOMPurify.sanitize(''); // becomes
```
--------------------------------
### 调试模式 (Bash)
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/README.md
运行工具时启用调试模式,以查看详细的处理过程信息。
```Bash
node dist/index.js mixui --debug
```
--------------------------------
### CyclicRoll Horizontal and Vertical Scrolling Example
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/CyclicRoll 跑马灯.md
Provides a React example showcasing the CyclicRoll component with both horizontal ('horizon') and vertical ('vertical') scrolling directions. It demonstrates how to set the 'direction' and 'speed' props, along with basic styling.
```tsx
import React from 'react'
import { CyclicRoll } from '@kfe/mix-ui'
import './cyclicRoll.less'
export default () => {
return (
<>
横向滚动
1
2
3
纵向滚动
1
2
3
>
)
}
```
--------------------------------
### 查看帮助信息 (Bash)
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/README.md
显示文档处理工具的帮助信息和可用命令的命令。
```Bash
node dist/index.js --help
```
--------------------------------
### Tabs with Alignment Options
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Tabs 标签页.md
Demonstrates how to control the alignment of the tab bar using the 'align' prop, with options for 'start' and 'center'.
```tsx
import React from 'react'
import { Tabs } from '@kfe/mix-ui'
export default () => {
return (
{[1, 2, 3].map(item => (
内容 {item}
))}
{[1, 2, 3].map(item => (
内容 {item}
))}
)
}
```
--------------------------------
### Import Loading Component
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Loading 加载.md
Demonstrates how to import the Loading component from the '@kfe/mix-ui' library.
```js
import { Loading } from '@kfe/mix-ui';
```
--------------------------------
### XSS Protection Example
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/RichText 富文本展示.md
Illustrates the XSS protection capabilities of the RichText component by rendering potentially malicious HTML, such as an image with an onerror attribute.
```tsx
import React from 'react'
import { RichText } from '@kfe/mix-ui'
import { DemoBlock } from 'demos'
export default () => {
return (
)
}
```
--------------------------------
### 自定义源/目标目录 (Bash)
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/README.md
运行文档处理器时,指定自定义源目录和目标目录的命令。
```Bash
node dist/index.js mixui --source-dir custom/source --target-dir custom/output
```
--------------------------------
### HorizontalCard with Image Cover
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/HorizontalCard 横向卡片.md
Illustrates how to use the HorizontalCard component with an image as a cover. This example includes importing the Image component and applying custom styling.
```tsx
import React from 'react'
import { DemoBlock } from 'demos'
import { HorizontalCard, Image } from '@kfe/mix-ui'
import './index.less'
export default () => {
return (
}
>
自定义内容
)
}
```
--------------------------------
### Import Image Component
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Image 图片.md
Demonstrates how to import the Image component from the '@kfe/mix-ui' library. This is the initial step to use the component in your project.
```javascript
import { Image } from '@kfe/mix-ui';
```
--------------------------------
### CountDown with Custom Format
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/CountDown 倒计时.md
Illustrates how to customize the displayed countdown text using the 'format' prop. The example sets a format for days, hours, minutes, and seconds.
```tsx
import React from 'react'
import { CountDown } from '@kfe/mix-ui'
import { DemoBlock } from 'demos'
import './style.less'
export default () => {
return (
)
}
```
--------------------------------
### 安装依赖 (Bash)
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/README.md
用于安装项目所需依赖的命令。通常在项目初始化或更新后执行。
```Bash
pnpm install
```
--------------------------------
### Basic HorizontalCard Usage
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/HorizontalCard 横向卡片.md
Shows the fundamental usage of the HorizontalCard component, displaying a title and custom content. This serves as a starting point for integrating the card into your application.
```tsx
import React from 'react'
import { DemoBlock } from 'demos'
import { HorizontalCard } from '@kfe/mix-ui'
export default () => {
return (
自定义内容
)
}
```
--------------------------------
### 配置环境变量 (Bash)
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/README.md
通过设置环境变量来调整工具的行为,例如关闭敏感信息清理。
```Bash
CLEAN_SENSITIVE=false
```
--------------------------------
### Using CollapseItem Ref to Toggle Panel
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Collapse 折叠面板.md
Provides an example of how to use a ref to access a `CollapseItem` instance and call its `toggle` method to programmatically expand or collapse the panel.
```ts
import { useRef } from 'react';
import type { CollapseItemInstance } from '@kfe/mix-ui';
const collapseItemRef = useRef(null);
collapseItemRef.current?.toggle();
```
--------------------------------
### Import Button Component
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Button 按钮.md
Demonstrates how to import the Button component from the '@kfe/mix-ui' library.
```javascript
import { Button } from '@kfe/mix-ui';
```
--------------------------------
### 加载状态 - Switch
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Switch 开关.md
演示如何通过 `loading` 属性将 Switch 组件设置为加载状态,此时开关不可点击。
```tsx
import React from 'react'
import { Switch } from '@kfe/mix-ui'
export default () => {
return
}
```
--------------------------------
### 添加新的处理器 (TypeScript)
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/README.md
演示如何扩展新的文档处理器。需要实现 `IDocProcessor` 接口并注册到主入口文件中。
```TypeScript
import { IDocProcessor, ProcessOptions } from '../types/index.js';
export class MyProcessor implements IDocProcessor {
public readonly name = 'my-library';
async process(options: ProcessOptions = {}): Promise {
// 实现你的处理逻辑
}
}
```
```TypeScript
import { MyProcessor } from './processors/my-processor.js';
const processors: Record = {
mixui: new MixUIProcessor(),
mylibrary: new MyProcessor(), // 添加新的处理器
};
```
--------------------------------
### Enable Popup for DatetimePicker
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/DatetimePicker 时间选择.md
Illustrates how to enable the popup feature for DatetimePicker using the 'popup' prop. This example also shows how to integrate it with a Field component and use 'onConfirm' for value updates.
```tsx
import React, { useState } from 'react'
import { DatetimePicker, Field } from '@kfe/mix-ui'
export default () => {
const [value, setValue] = useState(new Date())
return (
{(val, _, actions) => {
return (
actions.open()}
/>
)
}}
)
}
```
--------------------------------
### Import Input Component
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Input 输入框.md
Demonstrates how to import the Input component from the '@kfe/mix-ui' library.
```js
import { Input } from '@kfe/mix-ui';
```
--------------------------------
### Basic Tabs Usage and Styles
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Tabs 标签页.md
Shows the basic implementation of the Tabs component with different display styles: line, capsule, jumbo (with descriptions), and card. It includes examples of how to structure TabPanes and their content.
```tsx
import React from 'react'
import { Tabs } from '@kfe/mix-ui'
import './style.less'
const items = Array.from({ length: 3 }, (_, i) => i + 1)
const signItems = [
{
title: '头1',
content: '内容1',
description: '哈哈哈哈',
sign: {
content: ,
left: '0px',
top: '0px'
}
},
{
title: '头2',
content: '内容2',
description: '哈哈哈哈',
sign: {
content: ,
left: '10px',
bottom: '10px'
}
},
{
title: '头3',
content: '内容3',
description: '哈哈哈哈',
sign: {
content: ,
right: '20px',
top: '20px'
}
}
]
export default () => {
return (
{items.map(item => (
下划线标签页 {item}
))}
{items.map(item => (
胶囊标签页 {item}
))}
{items.map(item => (
胶囊2标签页 {item}
))}
{signItems.map((item, index) => (
{item.content}
))}
{items.map(item => (
卡片标签页 {item}
))}
)
}
```
--------------------------------
### Disabled Button State
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Button 按钮.md
Shows how to disable buttons using the `disabled` prop, making them unclickable. This example includes disabled buttons with primary, pay, default types, and with/without the `surface` and `stroke` props.
```tsx
import React from 'react'
import { Button } from '@kfe/mix-ui'
import { DemoBlock } from 'demos'
import './style.less'
export default () => {
return (
会员色
购买红
主题色
会员色
购买红
主题色
会员色
购买红
主题色
)
}
```
--------------------------------
### Steps Basic Usage
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/steps.md
Demonstrates the basic usage of the Steps component, allowing users to navigate through different stages of a process. It includes steps for order placement, order acceptance, pickup, and transaction completion. A button is provided to advance to the next step.
```js
import { Steps } from '@kfe/mix-ui';
```
```tsx
import React, { useState } from 'react'
import { Steps, Button } from '@kfe/mix-ui'
import { DemoBlock } from 'demos'
export default () => {
const [active, setActive] = useState(1)
const nextStep = () => setActive((prev) => (prev >= 3 ? 0 : prev + 1))
return (
买家下单
商家接单
买家提货
交易完成
下一步
)
}
```
--------------------------------
### 贡献指南 - 提交更改 (Bash)
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/README.md
提交代码更改到本地仓库的 Git 命令。
```Bash
git commit -m 'Add some AmazingFeature'
```
--------------------------------
### Set Square Button Shape
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Button 按钮.md
Demonstrates how to create square-shaped buttons using the 'square' prop in the Mix UI Button component. This example shows primary, pay, and default button types with the square attribute.
```tsx
import React from 'react'
import { Button } from '@kfe/mix-ui'
import { DemoBlock } from 'demos'
import './style.less'
export default () => {
return (
会员色
购买红
主题色
)
}
```
--------------------------------
### 引入 Sticky 组件
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Sticky 粘性布局.md
演示如何从 '@kfe/mix-ui' 库中引入 Sticky 组件。
```js
import { Sticky } from '@kfe/mix-ui';
```
--------------------------------
### Import Empty Component
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Empty 空状态.md
Demonstrates how to import the Empty component from the '@kfe/mix-ui' library.
```javascript
import { Empty } from '@kfe/mix-ui';
```
--------------------------------
### CountDown Manual Control with Refs
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/CountDown 倒计时.md
Shows how to control the CountDown component manually using refs. The 'start', 'pause', and 'reset' methods can be called on the component instance. Includes 'autoStart={false}' and 'onFinish' event handling.
```tsx
import React, { useRef } from 'react'
import { CountDown, Toast, Button } from '@kfe/mix-ui'
import type { CountDownInstance } from '@kfe/mix-ui'
import { DemoBlock } from 'demos'
import './style.less'
export default () => {
const ref = useRef(null)
return (
Toast.info('倒计时结束')}
/>
ref.current?.start()}
/>
ref.current?.pause()}
/>
ref.current?.reset()}
/>
)
}
```
--------------------------------
### Controlling Picker Visibility with useRef
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Picker 选择器.md
Demonstrates how to use React's `useRef` hook to get a reference to the Picker instance and call its methods like `open()`, `close()`, or `toggle()` to manage the picker's visibility.
```TypeScript
import { useRef } from 'react';
import type { PickerInstance } from '@kfe/mix-ui';
const pickerRef = useRef();
pickerRef.current?.open();
```
--------------------------------
### Import WechatOverlay
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/WechatOverlay 微信遮罩.md
Demonstrates how to import the WechatOverlay component from the '@kfe/mix-ui' library.
```javascript
import { WechatOverlay } from '@kfe/mix-ui';
```
--------------------------------
### 构建项目 (Bash)
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/README.md
用于构建项目的命令,将 TypeScript 代码编译为可执行的 JavaScript。
```Bash
pnpm build
```
--------------------------------
### Popup Positioning
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Popup 弹出层.md
Illustrates how to control the Popup's position using the `position` prop. It supports 'top', 'bottom', 'left', 'right', and defaults to center. The example uses state to manage different positions triggered by buttons.
```tsx
import React, { useState } from 'react'
import { Button, Popup, PopupPosition } from '@kfe/mix-ui'
export default () => {
const [state, setState] = useState('')
const onClose = () => setState('')
return (
<>
setState('top')}>顶部弹出
setState('bottom')}>底部弹出
setState('left')}>左侧弹出
setState('right')}>右侧弹出
>
)
}
```
--------------------------------
### 贡献指南 - 推送到分支 (Bash)
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/README.md
将本地分支的更改推送到远程仓库的 Git 命令。
```Bash
git push origin feature/AmazingFeature
```
--------------------------------
### Basic Overlay Usage
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Overlay 遮罩.md
Shows a basic example of using the Overlay component in React. It includes a button to toggle the overlay's visibility and demonstrates how to control the overlay using the `visible` prop and close it by clicking outside.
```tsx
import React, { useState } from 'react'
import { Button, Overlay } from '@kfe/mix-ui'
export default () => {
const [show, setShow] = useState(false)
return (
<>
setShow(true)}>
显示遮罩层
setShow(false)} />
>
)
}
```
--------------------------------
### 贡献指南 - 创建特性分支 (Bash)
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/README.md
在贡献代码时,创建新的特性分支的 Git 命令。
```Bash
git checkout -b feature/AmazingFeature
```
--------------------------------
### Max UI Checkbox and CheckboxGroup Instance Types
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Checkbox 复选框.md
Demonstrates how to use TypeScript to get the instance types for Checkbox and CheckboxGroup components in React. It shows how to create refs and call methods like 'toggle' and 'toggleAll' on these instances.
```TypeScript
import { useRef } from 'react';
import type { CheckboxInstance, CheckboxGroupInstance } from '@kfe/max-ui';
const checkboxRef = useRef();
const checkboxGroupRef = useRef();
checkboxRef.current?.toggle();
checkboxGroupRef.current?.toggleAll();
```
--------------------------------
### 引入 Switch 组件
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Switch 开关.md
展示如何从 '@kfe/mix-ui' 库中引入 Switch 组件。
```js
import { Switch } from '@kfe/mix-ui';
```
--------------------------------
### Customize Button Second Line Text
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Button 按钮.md
Illustrates how to add and customize the second line of text on buttons using the 'secondText' prop. This example shows how to display additional information below the main button text for different button types.
```tsx
import React from 'react'
import { Button } from '@kfe/mix-ui'
import { DemoBlock } from 'demos'
import './style.less'
export default () => {
return (
新会员首月仅 0.3 元/天
新会员首月仅 0.3 元/天
新会员首月仅 0.3 元/天
)
}
```
--------------------------------
### 引入 Pag 组件
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Pag 动画工作流.md
展示了如何在项目中使用 `@kfe/mix-ui` 库引入 `Pag` 组件。这是一个基础的 JavaScript 导入语句。
```javascript
import { Pag } from '@kfe/mix-ui';
```
--------------------------------
### Overlay with Embedded Content
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Overlay 遮罩.md
Illustrates how to embed custom content within the Overlay component. This example shows a button to trigger the overlay, which then displays a styled div in its center. The overlay's visibility is managed using React's `useState` hook.
```tsx
import React, { useState } from 'react'
import { Button, Overlay } from '@kfe/mix-ui'
export default () => {
const [visible, setVisible] = useState(false)
return (
<>
setVisible(true)}>
嵌入内容
setVisible(false)}>
>
)
}
```
--------------------------------
### Customizing Icon Size and Color with Mix-UI
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Icons 图标.md
Illustrates how to customize the size and color of icons imported from '@kfe/mix-ui'. Examples show setting a custom size (e.g., 100, 120) and color (e.g., 'red') for icons like 'ArrowClockwise' and 'Vip'.
```typescript
import React from 'react'
import {
ArrowClockwise24,
Vip24
} from '@kfe/mix-ui'
import { DemoBlock } from 'demos'
export default () => {
return (
)
}
```
--------------------------------
### 引入 Swiper 组件
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Swiper 轮播.md
这是引入 Swiper 组件的基本方式,通常在项目文件顶部进行。它依赖于 '@kfe/mix-ui' 库。
```js
import { Swiper } from '@kfe/mix-ui';
```
--------------------------------
### Import Lazyload Component
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Lazyload 懒加载.md
Demonstrates how to import the Lazyload component from the '@kfe/mix-ui' library.
```javascript
import { Lazyload } from '@kfe/mix-ui';
```
--------------------------------
### Mix-UI Form with Various Item Types
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Form 表单.md
This snippet demonstrates how to use the Mix-UI Form component with various standard form item types. It includes examples for Checkbox, Checkbox.Group, Radio.Group, Picker, and Input.TextArea. The form is configured with a submit button and basic layout.
```tsx
import React from 'react'
import {
Button,
Checkbox,
Input,
Radio,
Form,
Picker
} from '@kfe/mix-ui'
import { DemoBlock } from 'demos'
export default () => {
const [form] = Form.useForm()
const onFinish = values => {
console.log(values)
}
return (
复选框1
复选框2
单选框1
单选框2
{
action.current?.open()
}}
>
{val => val || '请选择城市'}
)
}
```
--------------------------------
### Import Popup Component
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Popup 弹出层.md
Demonstrates how to import the Popup component from the '@kfe/mix-ui' library.
```js
import { Popup } from '@kfe/mix-ui';
```
--------------------------------
### Form.useWatch for Update Subscription
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Form 表单.md
This example demonstrates using Form.useWatch to subscribe to form field changes and re-render components accordingly. It watches the 'account' and 'type' fields to display user login information, and conditionally renders input fields based on the selected login method.
```tsx
import React from 'react'
import { Form, Input, Button, Radio, Space } from '@kfe/mix-ui'
import { DemoBlock } from 'demos'
interface FieldType { account?: string, loginMethod?: 'mobile' | 'email' }
export default function () {
const [form] = Form.useForm()
const account = Form.useWatch('account', form)
const type = Form.useWatch('type', form)
console.log('watch rerender')
return (
手机号
邮箱
{type === 'mobile' && (
)}
{type === 'email' && (
)}
)
}
```
--------------------------------
### Import Overlay Component
Source: https://github.com/zvip-fe/mix-mkt-open-docs/blob/main/docs/mix-ui/Overlay 遮罩.md
Demonstrates how to import the Overlay component from the '@kfe/mix-ui' library into your JavaScript project.
```js
import { Overlay } from '@kfe/mix-ui';
```