diff --git a/src/packages/icon/demos/h5/demo7.tsx b/src/packages/icon/demos/h5/demo7.tsx index bbb63f6d3e..bbc616e1f8 100644 --- a/src/packages/icon/demos/h5/demo7.tsx +++ b/src/packages/icon/demos/h5/demo7.tsx @@ -6,7 +6,7 @@ import { camelCase } from '@/utils/camel-case' const generateAMCopyText = (icon: any) => { return `<${camelCase(icon.name, { pascalCase: true, - })} className="${`nut-icon-${icon['animation-name']} nut-icon-${icon['animation-time']}`}" />` + })} className="${`nut-icon-${icon['animation-name']} nut-icon-${icon['animation-time']}`}" />` } const copyTag = (text: string) => { @@ -37,7 +37,7 @@ const Demo7 = () => { > ) diff --git a/src/packages/icon/demos/taro/demo7.tsx b/src/packages/icon/demos/taro/demo7.tsx index 331abb32ac..36b217d41a 100644 --- a/src/packages/icon/demos/taro/demo7.tsx +++ b/src/packages/icon/demos/taro/demo7.tsx @@ -1,16 +1,13 @@ import React, { useState } from 'react' import { IconFontConfig, IconFont } from '@nutui/icons-react-taro' -import { Cell } from '@/packages/nutui.react.taro' +import { Cell, Toast } from '@/packages/nutui.react.taro' import { camelCase } from '@/utils/camel-case' const Demo7 = () => { - const generateCopyText = (name: string) => { - return `<${camelCase(name, { pascalCase: true })} />` - } const generateAMCopyText = (icon: any) => { return `<${camelCase(icon.name, { pascalCase: true, - })} className='${`nut-icon-${icon['animation-name']} nut-icon-${icon['animation-time']}`}' />` + })} className='${`nut-icon-${icon['animation-name']} nut-icon-${icon['animation-time']}`}' />` } const copyTag = (text: string) => { const input = document.createElement('input') @@ -23,20 +20,13 @@ const Demo7 = () => { document.body.removeChild(input) } const [state, setState] = useState({ - msg: '', - type: 'text', - cover: false, + content: '', visible: false, - duration: 2, - closeOnOverlayClick: false, - title: '', - bottom: '', - icon: '', - center: true, }) return ( <> + {(IconFontConfig as any).style.map((item: any) => { return ( @@ -58,7 +48,7 @@ const Demo7 = () => { setState({ ...state, visible: true, - msg: generateCopyText(icon), + content: generateAMCopyText(icon), }) }} style={{ @@ -73,7 +63,7 @@ const Demo7 = () => { > )