MCPcopy Create free account
hub / github.com/HisMax/RedInk / insertPage

Function insertPage

frontend/src/stores/generator.ts:252–265  ·  view source on GitHub ↗

* 在指定位置后插入新页面 * @param afterIndex 在此索引后插入 * @param type 页面类型 * @param content 页面内容

(afterIndex: number, type: 'cover' | 'content' | 'summary', content: string = '')

Source from the content-addressed store, hash-verified

250 * @param content 页面内容
251 */
252 insertPage(afterIndex: number, type: 'cover' | 'content' | 'summary', content: string = '') {
253 const newPage: Page = {
254 index: afterIndex + 1,
255 type,
256 content
257 }
258 this.outline.pages.splice(afterIndex + 1, 0, newPage)
259 // 重新索引所有页面
260 this.outline.pages.forEach((page, idx) => {
261 page.index = idx
262 })
263 // 同步更新 raw 文本
264 this.syncRawFromPages()
265 },
266
267 /**
268 * 移动页面位置(用于拖拽排序)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected