Skip to content

Commit

Permalink
fix: useId方法会出现相同的id (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
vangleer committed Jun 27, 2024
1 parent 864a8b0 commit 9818de7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/editor/src/utils/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { ComponentType } from '../types'

let uid = 1

export function useId(prefix = 'drager') {
return `${prefix}${uid++}`
export function useId(prefix = 'es-drager') {
return `${prefix}-${Date.now()}-${uid++}`
}

export function deepCopy(obj: any) {
Expand Down

0 comments on commit 9818de7

Please sign in to comment.