mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
perf: 代码优化
This commit is contained in:
parent
20b0ff9d7b
commit
c7c9292ba6
@ -65,7 +65,7 @@ export default () => {
|
||||
}
|
||||
return {
|
||||
...slide,
|
||||
id: createRandomCode(8),
|
||||
id: createRandomCode(),
|
||||
}
|
||||
})
|
||||
slidesStore.addSlide(newSlides)
|
||||
|
@ -27,7 +27,7 @@ export default () => {
|
||||
// 重置幻灯片
|
||||
const resetSlides = () => {
|
||||
const emptySlide: Slide = {
|
||||
id: createRandomCode(8),
|
||||
id: createRandomCode(),
|
||||
elements: [],
|
||||
background: {
|
||||
type: 'solid',
|
||||
@ -74,7 +74,7 @@ export default () => {
|
||||
// 创建一页空白页并添加到下一页
|
||||
const createSlide = () => {
|
||||
const emptySlide: Slide = {
|
||||
id: createRandomCode(8),
|
||||
id: createRandomCode(),
|
||||
elements: [],
|
||||
background: {
|
||||
type: 'solid',
|
||||
@ -96,7 +96,7 @@ export default () => {
|
||||
}
|
||||
const newSlide = {
|
||||
...slide,
|
||||
id: createRandomCode(8),
|
||||
id: createRandomCode(),
|
||||
}
|
||||
mainStore.setActiveElementIdList([])
|
||||
slidesStore.addSlide(newSlide)
|
||||
|
@ -4,7 +4,7 @@ import { padStart } from 'lodash'
|
||||
* 生成随机码
|
||||
* @param len 随机码长度
|
||||
*/
|
||||
export const createRandomCode = (len = 6) => {
|
||||
export const createRandomCode = (len = 8) => {
|
||||
const charset = `_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`
|
||||
const maxLen = charset.length
|
||||
let ret = ''
|
||||
|
Loading…
x
Reference in New Issue
Block a user