Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wangjin-front-end
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
张媛
wangjin-front-end
Commits
34b73eaf
Commit
34b73eaf
authored
Jul 02, 2021
by
张媛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
story文件组织完善
parent
169b1da6
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
2538 additions
and
1655 deletions
+2538
-1655
addons.ts
.storybook/addons.ts
+4
-0
main.js
.storybook/main.js
+2
-15
package-lock.json
package-lock.json
+2487
-1618
package.json
package.json
+6
-0
index.ts
src/components/index.ts
+0
-0
testSpan.less
src/components/testSpan/testSpan.less
+0
-0
testSpan.tsx
src/components/testSpan/testSpan.tsx
+5
-0
Button.stories.tsx
src/stories/Button.stories.tsx
+17
-0
TestSpan.stories.tsx
src/stories/TestSpan.stories.tsx
+17
-0
index.tsx
src/stories/index.tsx
+0
-17
test.ts
src/stories/test.ts
+0
-5
No files found.
.storybook/addons.ts
0 → 100644
View file @
34b73eaf
import
'@storybook/addon-actions/register'
;
import
'@storybook/addon-links/register'
;
import
'@storybook/addon-notes/register'
;
import
'storybook-readme/register'
;
\ No newline at end of file
.storybook/main.js
View file @
34b73eaf
const
path
=
require
(
"path"
);
// your app's webpack.config.js
const
custom
=
require
(
'./webpack.config.js'
);
module
.
exports
=
{
module
.
exports
=
{
stories
:
[
'../src/stories/index.tsx'
],
stories
:
[
'../src/**/*.stories.tsx'
],
addons
:
[
};
{
\ No newline at end of file
"name"
:
"@storybook/preset-create-react-app"
,
"options"
:
{
"craOverrides"
:
{
"fileLoaderExcludes"
:
[
".less"
]
}
}
}
],
}
\ No newline at end of file
package-lock.json
View file @
34b73eaf
This diff is collapsed.
Click to expand it.
package.json
View file @
34b73eaf
...
@@ -12,14 +12,20 @@
...
@@ -12,14 +12,20 @@
"license"
:
"
ISC
"
,
"license"
:
"
ISC
"
,
"devDependencies"
:
{
"devDependencies"
:
{
"
@babel/core
"
:
"
^7.14.6
"
,
"
@babel/core
"
:
"
^7.14.6
"
,
"
@storybook/addon-actions
"
:
"
^6.3.2
"
,
"
@storybook/addon-links
"
:
"
^6.3.2
"
,
"
@storybook/addon-notes
"
:
"
^5.3.21
"
,
"
@storybook/addons
"
:
"
^6.3.2
"
,
"
@storybook/react
"
:
"
^6.3.2
"
,
"
@storybook/react
"
:
"
^6.3.2
"
,
"
@types/storybook__react
"
:
"
^5.2.1
"
,
"
@types/storybook__react
"
:
"
^5.2.1
"
,
"
babel-loader
"
:
"
^8.2.2
"
,
"
babel-loader
"
:
"
^8.2.2
"
,
"
babel-plugin-import
"
:
"
^1.13.3
"
,
"
babel-plugin-import
"
:
"
^1.13.3
"
,
"
storybook-readme
"
:
"
^5.0.9
"
,
"
typescript
"
:
"
^4.3.5
"
,
"
typescript
"
:
"
^4.3.5
"
,
"
webpack-combine-loaders
"
:
"
^2.0.4
"
"
webpack-combine-loaders
"
:
"
^2.0.4
"
},
},
"dependencies"
:
{
"dependencies"
:
{
"
@storybook/addon-docs
"
:
"
^6.3.2
"
,
"
@storybook/preset-ant-design
"
:
"
^0.0.2
"
,
"
@storybook/preset-ant-design
"
:
"
^0.0.2
"
,
"
antd
"
:
"
^4.16.6
"
,
"
antd
"
:
"
^4.16.6
"
,
"
babel-preset-react-app
"
:
"
^10.0.0
"
,
"
babel-preset-react-app
"
:
"
^10.0.0
"
,
...
...
src/components/index.ts
deleted
100644 → 0
View file @
169b1da6
src/
stories/index
.less
→
src/
components/testSpan/testSpan
.less
View file @
34b73eaf
File moved
src/components/testSpan/testSpan.tsx
0 → 100644
View file @
34b73eaf
import
React
from
'react'
;
import
"./testSpan.less"
;
export
const
TestSpan
=
(
obj
)
=>
{
return
<
span
className=
"testButton"
><
span
className
=
"
testButton
-
inner
"
></
span
>
{
obj
.
label
}
</
span
>
}
\ No newline at end of file
src/stories/Button.stories.tsx
0 → 100644
View file @
34b73eaf
import
React
from
'react'
;
import
{
Button
}
from
"@storybook/react/demo"
;
export
default
{
component
:
Button
,
title
:
'Components/Button'
,
};
//👇 We create a “template” of how args map to rendering
const
Template
=
(
args
)
=>
<
Button
{
...
args
}
/>;
//👇 Each story then reuses that template
export
const
Primary
=
Template
.
bind
({});
Primary
.
args
=
{
primary
:
true
,
label
:
'Button'
,
};
src/stories/TestSpan.stories.tsx
0 → 100644
View file @
34b73eaf
import
React
from
'react'
;
import
{
TestSpan
}
from
"../components/testSpan/testSpan"
;
export
default
{
component
:
TestSpan
,
title
:
'Components/TestSpan'
,
};
//👇 We create a “template” of how args map to rendering
const
Template
=
(
args
)
=>
<
TestSpan
{
...
args
}
/>;
//👇 Each story then reuses that template
export
const
Primary
=
Template
.
bind
({});
Primary
.
args
=
{
primary
:
true
,
label
:
'TestSpan'
,
};
src/stories/index.tsx
deleted
100644 → 0
View file @
169b1da6
import
React
from
"react"
;
import
{
storiesOf
}
from
"@storybook/react"
;
import
{
Button
}
from
"@storybook/react/demo"
;
import
"./test"
import
"./index.less"
storiesOf
(
"Button"
,
module
)
.
add
(
"with text"
,
()
=>
<
Button
>
Hello Button
</
Button
>)
.
add
(
"with emoji"
,
()
=>
(
<
Button
>
<
span
role=
"img"
aria
-
label=
"so cool"
>
</
span
>
</
Button
>
));
storiesOf
(
"TestButton"
,
module
)
.
add
(
"with text"
,
()
=>
<
span
className=
"testButton"
><
span
className
=
"
testButton
-
inner
"
></
span
></
span
>)
\ No newline at end of file
src/stories/test.ts
deleted
100644 → 0
View file @
169b1da6
const
a
=
1
;
function
add
(
b
:
number
){
return
b
+
a
}
console
.
log
(
add
(
3
))
\ No newline at end of file
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