Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
H5
yjtec-mob
Commits
eaba326f
Commit
eaba326f
authored
4 years ago
by
康帅杰
Browse files
Options
Download
Email Patches
Plain Diff
bug修复
parent
ec54d527
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
es/store-swapper/index.js
+1
-2
es/store-swapper/index.js
example/pages/components/scroll.js
+14
-15
example/pages/components/scroll.js
lib/store-swapper/index.js
+1
-2
lib/store-swapper/index.js
package.json
+1
-1
package.json
src/store-swapper/index.js
+1
-2
src/store-swapper/index.js
with
18 additions
and
22 deletions
+18
-22
es/store-swapper/index.js
View file @
eaba326f
...
...
@@ -69,7 +69,6 @@ var StoreSwapper = /*#__PURE__*/function (_React$Component) {
_this
.
handleTouchChange
=
function
(
_ref
)
{
var
direction
=
_ref
.
direction
;
var
size
=
_this
.
state
.
size
;
console
.
log
(
size
,
direction
);
if
(
direction
===
'
down
'
)
{
if
(
size
===
'
m
'
)
{
...
...
@@ -150,7 +149,7 @@ var StoreSwapper = /*#__PURE__*/function (_React$Component) {
}),
/*#__PURE__*/
React
.
createElement
(
"
div
"
,
{
className
:
"
content
"
},
React
.
cloneElement
(
children
[
1
],
{
disabled
:
fals
e
pageSize
:
siz
e
}))));
}
}]);
...
...
This diff is collapsed.
Click to expand it.
example/pages/components/scroll.js
View file @
eaba326f
...
...
@@ -3,20 +3,20 @@ import Scroll from 'react-bscroll';
import
'
react-bscroll/lib/react-scroll.css
'
;
class
ScrollComponent
extends
React
.
Component
{
getSnapshotBeforeUpdate
(
prevProps
,
prevState
){
this
.
scroll
.
getScrollObj
().
refresh
();
return
null
;
}
componentDidUpdate
(
prevProps
){
if
(
this
.
props
.
disabled
!==
prevProps
.
disabled
){
this
.
forceUpdate
();
}
console
.
log
(
this
.
props
,
prevProps
);
//this.forceUpdate();
//console.log(this.scroll.getScrollObj());
//console.log(this.scroll.getScrollObj().refresh);
//this.scroll.getScrollObj().refresh();
}
//
getSnapshotBeforeUpdate(prevProps, prevState){
//
this.scroll.getScrollObj().refresh();
//
return null;
//
}
//
componentDidUpdate(prevProps){
//
if(this.props.disabled !== prevProps.disabled){
//
this.forceUpdate();
//
}
//
console.log(this.props,prevProps);
//
//this.forceUpdate();
//
//console.log(this.scroll.getScrollObj());
//
//console.log(this.scroll.getScrollObj().refresh);
//
//this.scroll.getScrollObj().refresh();
//
}
render
(){
const
{
disabled
...
...
@@ -25,7 +25,6 @@ class ScrollComponent extends React.Component{
<
Scroll
ref
=
{
sc
=>
this
.
scroll
=
sc
}
click
disabled
=
{
disabled
}
stopPropagation
=
{
false
}
>
{
Array
.
apply
(
null
,
Array
(
100
)).
map
((
item
,
i
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
lib/store-swapper/index.js
View file @
eaba326f
...
...
@@ -81,7 +81,6 @@ var StoreSwapper = /*#__PURE__*/function (_React$Component) {
_this
.
handleTouchChange
=
function
(
_ref
)
{
var
direction
=
_ref
.
direction
;
var
size
=
_this
.
state
.
size
;
console
.
log
(
size
,
direction
);
if
(
direction
===
'
down
'
)
{
if
(
size
===
'
m
'
)
{
...
...
@@ -162,7 +161,7 @@ var StoreSwapper = /*#__PURE__*/function (_React$Component) {
}),
/*#__PURE__*/
_react
.
default
.
createElement
(
"
div
"
,
{
className
:
"
content
"
},
_react
.
default
.
cloneElement
(
children
[
1
],
{
disabled
:
fals
e
pageSize
:
siz
e
}))));
}
}]);
...
...
This diff is collapsed.
Click to expand it.
package.json
View file @
eaba326f
{
"name"
:
"yjtec-mob"
,
"version"
:
"1.0.
0
"
,
"version"
:
"1.0.
1
"
,
"description"
:
"yjtec mob components"
,
"main"
:
"lib/index.js"
,
"module"
:
"dist/index.esm.js"
,
...
...
This diff is collapsed.
Click to expand it.
src/store-swapper/index.js
View file @
eaba326f
...
...
@@ -50,7 +50,6 @@ class StoreSwapper extends React.Component{
handleTouchChange
=
({
direction
})
=>
{
const
{
size
}
=
this
.
state
;
console
.
log
(
size
,
direction
);
if
(
direction
===
'
down
'
){
if
(
size
===
'
m
'
){
this
.
setState
({
...
...
@@ -110,7 +109,7 @@ class StoreSwapper extends React.Component{
<
div
onClick
=
{
this
.
handleArrowClick
}
className
=
{
`arrow-second
${(
size
===
'
m
'
&&
shouldSmall
)
||
size
===
'
l
'
?
'
down
'
:
''
}
`
}
><
/div
>
<
div
className
=
"
content
"
>
{
React
.
cloneElement
(
children
[
1
],{
disabled
:
fals
e
pageSize
:
siz
e
})}
<
/div
>
<
/Touch
>
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help