Skip to content

Commit

Permalink
fix(swipe-action): 不再以自增作为id
Browse files Browse the repository at this point in the history
  • Loading branch information
hejiasheng committed Jun 11, 2019
1 parent f97223f commit 9b0a901
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/swipe-action/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { View, Text } from '@tarojs/components'
import PropTypes from 'prop-types'
import classNames from 'classnames'

import _random from 'lodash/random'
import _isNil from 'lodash/isNil'
import _isEmpty from 'lodash/isEmpty'
import _inRange from 'lodash/inRange'
Expand All @@ -13,8 +14,6 @@ import AtComponent from '../../common/component'
import AtSwipeActionOptions from './options/index'
import { delayGetClientRect, delayGetScrollOffset } from '../../common/utils'

let id = 0

export default class AtSwipeAction extends AtComponent {
constructor (props) {
super(...arguments)
Expand All @@ -31,7 +30,7 @@ export default class AtSwipeAction extends AtComponent {
this.isTouching = false

this.state = {
componentId: ++id,
componentId: Date.now() + _random(0, 10000),
offsetSize: 0,
_isOpened: isOpened
}
Expand Down

0 comments on commit 9b0a901

Please sign in to comment.