Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
my-date-component
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SuYK
my-date-component
Commits
d5d51624
Commit
d5d51624
authored
Mar 22, 2023
by
SuYK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
End
parent
893e1a69
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
6 deletions
+18
-6
README.md
README.md
+14
-2
DateTimePicker.scss
src/components/DateTimePicker/DateTimePicker.scss
+0
-0
DateTimePicker.tsx
src/components/DateTimePicker/DateTimePicker.tsx
+2
-2
DateType.ts
src/components/DateTimePicker/DateType.ts
+0
-0
index.tsx
src/pages/index/index.tsx
+2
-2
No files found.
README.md
View file @
d5d51624
hello world
组件兼容H5和小程序,
\ No newline at end of file
组件位置:src
\c
omponents
\D
ateTimePicker
\D
ateTimePicker.tsx
文件说明: src
\c
omponents
\D
ateTimePicker
\D
ateType 文件控制时间格式
h5运行指令:pnpm dev:h5
小程序运行指令: pnpm dev:weapp 、然后用微信开发者工具打开dist目录
src/components/
myDate/myDate
.scss
→
src/components/
DateTimePicker/DateTimePicker
.scss
View file @
d5d51624
File moved
src/components/
myDate/myDate
.tsx
→
src/components/
DateTimePicker/DateTimePicker
.tsx
View file @
d5d51624
import
{
Component
,
PropsWithChildren
}
from
'react'
import
{
Component
,
PropsWithChildren
}
from
'react'
import
{
View
}
from
'@tarojs/components'
import
{
View
}
from
'@tarojs/components'
import
formatDate
from
'../../utils/DateFun'
import
formatDate
from
'../../utils/DateFun'
import
'./
myDate
.scss'
import
'./
DateTimePicker
.scss'
import
DATETYPE
from
'./DateType'
import
DATETYPE
from
'./DateType'
...
@@ -15,7 +15,7 @@ interface StateType {
...
@@ -15,7 +15,7 @@ interface StateType {
transientYear
:
number
transientYear
:
number
}
}
export
default
class
MyDate
extends
Component
<
PropsWithChildren
|
any
>
{
export
default
class
DateTimePicker
extends
Component
<
PropsWithChildren
|
any
>
{
state
:
Readonly
<
StateType
>
=
{
state
:
Readonly
<
StateType
>
=
{
date
:
new
Date
(),
date
:
new
Date
(),
...
...
src/components/
myDate
/DateType.ts
→
src/components/
DateTimePicker
/DateType.ts
View file @
d5d51624
File moved
src/pages/index/index.tsx
View file @
d5d51624
import
{
Component
,
PropsWithChildren
}
from
'react'
import
{
Component
,
PropsWithChildren
}
from
'react'
import
{
View
,
Text
,
Input
}
from
'@tarojs/components'
import
{
View
,
Text
,
Input
}
from
'@tarojs/components'
import
MyDate
from
'../../components/myDate/myDate
'
import
DateTimePicker
from
'../../components/DateTimePicker/DateTimePicker
'
import
'./index.scss'
import
'./index.scss'
interface
State
{
interface
State
{
...
@@ -38,7 +38,7 @@ export default class Index extends Component<PropsWithChildren> {
...
@@ -38,7 +38,7 @@ export default class Index extends Component<PropsWithChildren> {
<
Text
>
日期:
</
Text
>
<
Text
>
日期:
</
Text
>
<
Input
type=
'text'
placeholder=
'选择日期'
value=
{
this
.
state
.
date
}
disabled
onClick=
{
this
.
ChangeIsShow
}
/>
<
Input
type=
'text'
placeholder=
'选择日期'
value=
{
this
.
state
.
date
}
disabled
onClick=
{
this
.
ChangeIsShow
}
/>
</
View
>
</
View
>
{
this
.
state
.
isShow
&&
<
MyDate
showDate=
{
this
.
showDate
}
/>
}
{
this
.
state
.
isShow
&&
<
DateTimePicker
showDate=
{
this
.
showDate
}
/>
}
</
View
>
</
View
>
)
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment