@@ -2,12 +2,12 @@ var demoModel = function (name, cName, desc) {
2
2
var temp = {
3
3
demoitem : `import React from 'react'
4
4
import { Cell, ${ name } } from '@nutui/nutui-react'
5
- import { Dongdong } from '@nutui/icons-react'
5
+ // import { Dongdong } from '@nutui/icons-react'
6
6
7
7
const Demo1 = () => {
8
8
return (
9
9
<Cell>
10
- <${ name } ></ ${ name } >
10
+ <${ name } / >
11
11
</Cell>
12
12
)
13
13
}
@@ -16,12 +16,12 @@ export default Demo1
16
16
` ,
17
17
tarodemoitem : `import React from 'react'
18
18
import { Cell, ${ name } } from '@nutui/nutui-react-taro'
19
- import { Dongdong } from '@nutui/icons-react-taro'
19
+ // import { Dongdong } from '@nutui/icons-react-taro'
20
20
21
21
const Demo1 = () => {
22
22
return (
23
23
<Cell>
24
- <${ name } ></ ${ name } >
24
+ <${ name } / >
25
25
</Cell>
26
26
)
27
27
}
@@ -35,20 +35,20 @@ import Demo1 from './demos/h5/demo1'
35
35
const ${ name } Demo = () => {
36
36
const [translated] = useTranslate({
37
37
'zh-CN': {
38
- title: '基础用法',
38
+ title: '基础用法',
39
39
},
40
40
'en-US': {
41
- title: 'Basic Usage',
41
+ title: 'Basic Usage',
42
42
},
43
43
'zh-TW': {
44
- title: '基礎用法',
44
+ title: '基礎用法',
45
45
},
46
46
})
47
47
return (
48
- <div className="demo">
49
- <h2>{translated.title}</h2>
50
- <Demo1 />
51
- </div>
48
+ <div className="demo">
49
+ <h2>{translated.title}</h2>
50
+ <Demo1 />
51
+ </div>
52
52
)
53
53
}
54
54
@@ -64,13 +64,13 @@ import Demo1 from './demos/taro/demo1'
64
64
const ${ name } Demo = () => {
65
65
const [translated] = useTranslate({
66
66
'zh-CN': {
67
- title: '基础用法',
67
+ title: '基础用法',
68
68
},
69
69
'en-US': {
70
- title: 'Basic Usage',
70
+ title: 'Basic Usage',
71
71
},
72
72
'zh-TW': {
73
- title: '基礎用法',
73
+ title: '基礎用法',
74
74
},
75
75
})
76
76
return (
@@ -79,66 +79,80 @@ const ${name}Demo = () => {
79
79
<ScrollView className={\`demo \${Taro.getEnv() === 'WEB' ? 'web' : ''}\`}>
80
80
<View className="h2">{translated.title}</View>
81
81
<Demo1 />
82
- </ScrollView>
82
+ </ScrollView>
83
83
</>
84
84
)
85
85
}
86
86
87
87
export default ${ name } Demo
88
88
` ,
89
- index : `import {${ name } } from './${ name . toLowerCase ( ) } '
89
+ index : `import { ${ name } } from './${ name . toLowerCase ( ) } '
90
+
90
91
export type { ${ name } Props } from './types'
91
92
export default ${ name }
92
93
` ,
93
94
94
- taroindex : `import {${ name } } from './${ name . toLowerCase ( ) } .taro'
95
+ taroindex : `import { ${ name } } from './${ name . toLowerCase ( ) } .taro'
96
+
95
97
export type { ${ name } Props } from './types'
96
- export default ${ name }
98
+ export default ${ name }
97
99
` ,
98
100
types : `import { BasicComponent } from '@/utils/typings'
99
- export interface ${ name } Props extends BasicComponent {
100
101
101
- }
102
+ export interface ${ name } Props extends BasicComponent { }
102
103
` ,
103
104
react : `import React, { FunctionComponent } from 'react'
105
+ import classNames from 'classnames'
104
106
import { ComponentDefaults } from '@/utils/typings'
105
107
import { ${ name } Props } from './types'
106
- import classNames from 'classnames'
107
- import { useConfig } from '@/packages/configprovider'
108
- import { useRtl } from '@/packages/configprovider'
108
+ // import { useConfig } from '@/packages/configprovider'
109
+ // import { useRtl } from '@/packages/configprovider'
109
110
110
111
const defaultProps = {
111
- ...ComponentDefaults,
112
+ ...ComponentDefaults,
112
113
} as ${ name } Props
113
- export const ${ name } : FunctionComponent<Partial<${ name } Props> & React.HTMLAttributes<HTMLDivElement>> = (props) => {
114
- const { locale } = useConfig()
115
- const rtl = useRtl()
114
+ export const ${ name } : FunctionComponent<
115
+ Partial<PickerViewProps> & React.HTMLAttributes<HTMLDivElement>
116
+ > = (props) => {
117
+ // const { locale } = useConfig()
118
+ // const rtl = useRtl()
116
119
const { className, style } = { ...defaultProps, ...props }
117
120
const classPrefix = 'nut-${ name . toLowerCase ( ) } '
118
121
const cls = classNames(classPrefix, className)
119
- return <div className={cls} style={style}>${ name } </div>
122
+ return (
123
+ <div className={cls} style={style}>
124
+ PickerView
125
+ </div>
126
+ )
120
127
}
121
128
122
129
${ name } .displayName = 'Nut${ name } '
123
130
` ,
124
131
taroreact : `import React, { FunctionComponent } from 'react'
132
+ import classNames from 'classnames'
133
+ import { View } from '@tarojs/components'
125
134
import { ComponentDefaults } from '@/utils/typings'
126
135
import { ${ name } Props } from './types'
127
- import { View } from '@tarojs/components'
128
- import classNames from 'classnames'
129
- import { useConfig } from '@/packages/configprovider/configprovider.taro'
130
- import { useRtl } from '@/packages/configprovider/index.taro'
136
+
137
+ // import { useConfig } from '@/packages/configprovider/configprovider.taro'
138
+ // import { useRtl } from '@/packages/configprovider/index.taro'
131
139
132
140
const defaultProps = {
133
- ...ComponentDefaults,
141
+ ...ComponentDefaults,
134
142
} as ${ name } Props
135
- export const ${ name } : FunctionComponent<Partial<${ name } Props> & React.HTMLAttributes<HTMLDivElement>> = (props) => {
136
- const { locale } = useConfig()
137
- const rtl = useRtl()
143
+ export const ${ name } : FunctionComponent<
144
+ Partial<PickerViewProps> & React.HTMLAttributes<HTMLDivElement>
145
+ > = (props) => {
146
+ // const { locale } = useConfig()
147
+ // const rtl = useRtl()
138
148
const { className, style } = { ...defaultProps, ...props }
139
149
const classPrefix = 'nut-${ name . toLowerCase ( ) } '
140
150
const cls = classNames(classPrefix, className)
141
- return <View className={cls} style={style}>${ name } </View>
151
+ return (
152
+ <View className={cls} style={style}>
153
+ PickerView
154
+ </View>
155
+ )
142
156
}
143
157
144
158
${ name } .displayName = 'Nut${ name } '
@@ -186,9 +200,7 @@ import '@testing-library/jest-dom'
186
200
import { ${ name } } from '../${ name . toLowerCase ( ) } '
187
201
188
202
test('should match snapshot', () => {
189
- const { container } = render(
190
- <${ name } ></${ name } >
191
- )
203
+ const { container } = render(<${ name } />)
192
204
expect(container).toMatchSnapshot()
193
205
})
194
206
` ,
0 commit comments