Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/packages/icon/demo.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const IconDemo = () => {
<Toast
content={state.msg}
visible={state.visible}
type={state.type}
duration={state.duration}
icon={state.icon}
closeOnOverlayClick={state.closeOnOverlayClick}
Expand Down
2 changes: 1 addition & 1 deletion src/packages/icon/demos/taro/demo6.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Demo6 = () => {

return (
<>
<Toast visible={state.visible} content={state.content} type="text" />
<Toast visible={state.visible} content={state.content} />
{(iconfonts.IconFontConfig as any).data.map((item: any) => {
return (
<Cell.Group key={item.name} title={item.name}>
Expand Down
2 changes: 1 addition & 1 deletion src/packages/icon/demos/taro/demo7.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Demo7 = () => {

return (
<>
<Toast visible={state.visible} content={state.content} type="text" />
<Toast visible={state.visible} content={state.content} />
{(iconfonts.IconFontConfig as any).style.map((item: any) => {
return (
<Cell.Group key={item.name} title={item.name}>
Expand Down
1 change: 0 additions & 1 deletion src/packages/infiniteloading/demos/taro/demo2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ const Demo2 = () => {
</InfiniteLoading>
</View>
<Toast
type="text"
visible={show}
content={toastMsg}
onClose={() => {
Expand Down
7 changes: 2 additions & 5 deletions src/packages/inputnumber/demos/taro/demo3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ import { Cell, InputNumber, Toast } from '@nutui/nutui-react-taro'

const Demo3 = () => {
const overlimit = () => {
toastShow('超出限制事件触发', 'warn')
toastShow('超出限制事件触发')
}
const [show, SetShow] = useState(false)
const [toastMsg, SetToastMsg] = useState('')
const [toastType, SetToastType] = useState('text')

const toastShow = (msg: any, type: string) => {
const toastShow = (msg: string) => {
SetToastMsg(msg)
SetToastType(type)
SetShow(true)
}

Expand All @@ -29,7 +27,6 @@ const Demo3 = () => {
/>
</Cell>
<Toast
type={toastType}
visible={show}
content={toastMsg}
onClose={() => {
Expand Down
7 changes: 2 additions & 5 deletions src/packages/inputnumber/demos/taro/demo8.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@ const Demo8 = () => {
const [inputValue, setInputValue] = useState(0)
const [show, setShow] = useState(false)
const [toastMsg, setToastMsg] = useState('')
const [toastType, setToastType] = useState('text')

const toastShow = (msg: any, type: string) => {
const toastShow = (msg: any) => {
setToastMsg(msg)
setToastType(type)
setShow(true)
}
const overlimit = (e: any) => {
console.log('超出限制事件触发', e)
}

const beforeChange = (value: number | string): Promise<boolean> => {
toastShow('异步演示 2 秒后更改', 'loading')
toastShow('异步演示 2 秒后更改')

return new Promise((resolve) => {
setTimeout(() => {
Expand All @@ -39,7 +37,6 @@ const Demo8 = () => {
/>
</Cell>
<Toast
type={toastType}
visible={show}
content={toastMsg}
onClose={() => {
Expand Down
20 changes: 2 additions & 18 deletions src/packages/inputnumber/demos/taro/demo9.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import React, { useState } from 'react'
import {
Cell,
InputNumber,
Toast,
ConfigProvider,
} from '@nutui/nutui-react-taro'
import React from 'react'
import { Cell, InputNumber, ConfigProvider } from '@nutui/nutui-react-taro'

const Demo9 = () => {
const customTheme3 = {
nutuiInputnumberInputWidth: '60px',
}
const [toastType, SetToastType] = useState('text')
const [show, SetShow] = useState(false)
const [toastMsg, SetToastMsg] = useState('')

return (
<>
Expand Down Expand Up @@ -40,14 +32,6 @@ const Demo9 = () => {
/>
</ConfigProvider>
</Cell>
<Toast
type={toastType}
visible={show}
content={toastMsg}
onClose={() => {
SetShow(false)
}}
/>
</>
)
}
Expand Down
1 change: 0 additions & 1 deletion src/packages/numberkeyboard/demos/taro/demo6.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const Demo6 = () => {
}}
/>
<Toast
type="text"
visible={show}
content={toastMsg}
onClose={() => {
Expand Down
1 change: 0 additions & 1 deletion src/packages/progress/demos/taro/demo7.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const Demo7 = () => {
<Cell.Group>
{!harmony() && (
<Toast
type="text"
visible={show}
content={toastMsg}
onClose={() => {
Expand Down
1 change: 0 additions & 1 deletion src/packages/pulltorefresh/demos/taro/demo4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const Demo4 = () => {
</PullToRefresh>
</ScrollView>
<Toast
type="text"
visible={show}
content={toastMsg}
onClose={() => {
Expand Down
1 change: 0 additions & 1 deletion src/packages/searchbar/demos/taro/demo3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const Demo3 = () => {
<SearchBar onSearch={() => toastShow()} />
</ConfigProvider>
<Toast
type="text"
visible={show}
content="search callback"
onClose={() => {
Expand Down
1 change: 0 additions & 1 deletion src/packages/searchbar/demos/taro/demo4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const Demo4 = () => {
<>
<SearchBar left="文本" right="测试" onSearch={() => toastShow()} />
<Toast
type="text"
visible={show}
content="search callback"
onClose={() => {
Expand Down
1 change: 0 additions & 1 deletion src/packages/switch/demos/taro/demo2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const Demo2 = () => {
/>
</Cell>
<Toast
type="text"
content={`2秒后异步触发 ${value}`}
visible={showToast}
onClose={() => {
Expand Down
1 change: 0 additions & 1 deletion src/packages/switch/demos/taro/demo6.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const Demo6 = () => {
/>
</Cell>
<Toast
type="text"
content={`触发了onChange事件,开关状态:${value}`}
visible={showToast}
onClose={() => {
Expand Down
1 change: 0 additions & 1 deletion src/packages/table/demo.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ const TableDemo = () => {
<Header />
<ScrollView className={`demo ${Taro.getEnv() === 'WEB' ? 'web' : ''}`}>
<Toast
type="text"
visible={show}
content={toastMsg}
onClose={() => {
Expand Down
1 change: 0 additions & 1 deletion src/packages/toast/demos/taro/demo2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const Demo5 = () => {
title: '函数调用函数调用',
content: '函数调用函数调用函数调用函数调用函数',
duration: 2,
position: 'center',
icon: <Jd color="#ffffff" />,
lockScroll: true,
onClose: () => {
Expand Down
1 change: 0 additions & 1 deletion src/packages/toast/doc.taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ import { Toast } from '@nutui/nutui-react-taro'
| size | 文案尺寸,三选一 | `small` \| `base` \| `large` | `base` |
| closeOnOverlayClick | 是否在点击遮罩层后关闭提示 | `boolean` | `false` |
| lockScroll | 背景是否锁定 | `boolean` | `false` |
| type | 弹框类型 可选值(text、success、fail、warn、loading) | `string` | `-` |
| visible | 弹窗是否显示开关 | `boolean` | `false` |
| wordBreak | 换行截断方式 | `normal \| break-all \| break-word ` | `break-all` |
| onClose | 关闭时触发的事件 | `Function` | `null` |
Expand Down
Loading