### Install Dependencies
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/README.md
Installs the project's dependencies using the pnpm package manager.
```Bash
pnpm install
```
--------------------------------
### Mix-UI Empty Basic Usage Examples
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/docs/mix-ui/Empty 空状态.md
Provides React examples for the Mix-UI Empty component, showcasing configurations with title, content, and buttons. It covers scenarios from just a title to title, content, and a button, as well as omitting the image.
```tsx
import React from 'react'
import { Empty } from '@kfe/mix-ui'
import { DemoBlock } from 'demos'
export default () => {
return (
<>
alert('OK')}
/>
>
)
}
```
--------------------------------
### Picker Instance Methods
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/docs/mix-ui/Picker 选择器.md
Demonstrates how to use the PickerInstance type to interact with the Picker component via a ref. Includes examples for opening, closing, and toggling the picker's visibility.
```TypeScript
import { useRef } from 'react';
import type { PickerInstance } from '@kfe/mix-ui';
const pickerRef = useRef();
pickerRef.current?.open();
```
--------------------------------
### CardLayout Content Loading Example
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/docs/mix-ui/CardLayout.md
Provides a React TypeScript example of using the CardLayout component to display custom content. It shows how to render multiple CardLayout instances within a DemoBlock.
```tsx
import React from 'react'
import { DemoBlock } from 'demos'
import { CardLayout } from '@kfe/mix-ui'
export default () => {
return (
CardLayout1CardLayout2CardLayout3
)
}
```
--------------------------------
### Basic Flex Layout Example
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/docs/mix-ui/Flex 布局.md
Shows a basic implementation of the Flex component, utilizing its 24-column grid system. It demonstrates how to create columns using Flex.Item and distribute space using the 'span' prop.
```tsx
import React from 'react'
import { Flex } from '@kfe/mix-ui'
import './style.less'
export default () => {
return (
span: 12span: 12span: 8span: 8span: 8
)
}
```
--------------------------------
### Basic Icon Usage with mix-ui
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/docs/mix-ui/Icons 图标.md
Shows how to render various icons from the mix-ui library in different sizes (16px and 24px). It includes examples like 'ArrowClockwise', 'ArrowDown', 'Alipay', and 'CurrencyBubble'.
```tsx
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 (
)
}
```
--------------------------------
### Image Component Usage (React)
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/docs/mix-ui/Image 图片.md
Example of how to use the Image component in a React application. This snippet demonstrates basic usage and assumes the component is imported and available.
```jsx
import React from 'react';
import { Image } from '@mix-market/ui';
const App = () => {
return (
<>
>
);
};
export default App;
```
--------------------------------
### Basic Overlay Usage
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/docs/mix-ui/Overlay 遮罩.md
Shows a basic example of using the Overlay component. It includes a button to toggle the overlay's visibility and the Overlay component itself, which can be closed by clicking on it.
```tsx
import React, { useState } from 'react'
import { Button, Overlay } from '@kfe/mix-ui'
export default () => {
const [show, setShow] = useState(false)
return (
<>
setShow(false)} />
>
)
}
```
--------------------------------
### Development Mode
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/README.md
Starts the project in development mode using pnpm dev. This typically enables features like hot-reloading or watch mode for automatic recompilation upon file changes.
```Bash
pnpm dev
```
--------------------------------
### Register New Processor (TypeScript)
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/README.md
Example of how to register a newly created document processor in the main script. This involves adding the new processor instance to the `processors` object, making it available for use.
```TypeScript
import { MyProcessor } from './processors/my-processor.js';
const processors: Record = {
mixui: new MixUIProcessor(),
mylibrary: new MyProcessor(), // 添加新的处理器
};
```
--------------------------------
### Mix UI Empty Component - Night Mode Example
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/docs/mix-ui/Empty 空状态.md
Demonstrates how to use the Mix UI Empty component in night mode by integrating with ConfigProvider and setting the theme to 'dark'. It showcases various Empty component configurations with different titles, content, and button texts.
```tsx
import React, { useEffect } from 'react'
import { Empty, ConfigProvider } from '@kfe/mix-ui'
import { DemoBlock } from 'demos'
export default () => {
useEffect(() => {
const root = document.documentElement
const oriValue = root.getAttribute('data-prefers-color')
root.setAttribute('data-prefers-color', 'dark')
return () => {
oriValue && root.setAttribute('data-prefers-color', oriValue)
}
}, [])
return (
alert('OK')}
/>
)
}
```
--------------------------------
### Import Steps Component
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/docs/mix-ui/steps.md
Demonstrates how to import the Steps component from the '@kfe/mix-ui' library.
```javascript
import { Steps } from '@kfe/mix-ui';
```
--------------------------------
### Tabs Alignment Options
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/docs/mix-ui/Tabs 标签页.md
Demonstrates how to change the alignment of the tab bar using the `align` prop. Examples show 'start' and 'center' alignments.
```tsx
import React from 'react'
import { Tabs } from '@kfe/mix-ui'
export default () => {
return (
)
}
```
--------------------------------
### Programmatic Toggle of CollapseItem
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/docs/mix-ui/Collapse 折叠面板.md
Demonstrates how to use a ref to get an instance of `CollapseItem` and call its `toggle` method. This allows for controlling the expanded state of a panel programmatically, for example, in response to other user interactions or application logic.
```ts
import { useRef } from 'react';
import type { CollapseItemInstance } from '@kfe/mix-ui';
const collapseItemRef = useRef(null);
collapseItemRef.current?.toggle();
```
--------------------------------
### Display Help Information
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/README.md
Displays the help information for the documentation processing tool. This command lists all available options and their descriptions.
```Bash
node dist/index.js --help
```
--------------------------------
### Import Loading Component
Source: https://github.com/zvip-fe/mix-market-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';
```
--------------------------------
### Enable Scrollspy and Sticky Navigation in Tabs
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/docs/mix-ui/Tabs 标签页.md
This example demonstrates how to enable scrollspy and sticky navigation for the Tabs component in React using TypeScript. The `scrollspy` prop configures the scroll behavior, while `sticky` enables the sticky positioning. This setup allows content to be displayed in a flat layout with enhanced navigation capabilities.
```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}
))}
)
}
```
--------------------------------
### Import Overlay Component
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/docs/mix-ui/Overlay 遮罩.md
Demonstrates how to import the Overlay component from the '@kfe/mix-ui' library.
```js
import { Overlay } from '@kfe/mix-ui';
```
--------------------------------
### DOMPurify Sanitization Examples
Source: https://github.com/zvip-fe/mix-market-open-docs/blob/main/docs/mix-ui/RichText 富文本展示.md
Provides examples of DOMPurify's sanitization capabilities, demonstrating how it cleans various types of potentially malicious HTML and SVG content.
```javascript
DOMPurify.sanitize(''); // becomes
DOMPurify.sanitize('