mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-03-21 03:30:42 +00:00
fix type
This commit is contained in:
@@ -74,7 +74,35 @@ async function add() {
|
||||
if (canceled || type == null) return;
|
||||
|
||||
const id = genId();
|
||||
children.value.push({ id, type });
|
||||
|
||||
// TODO: page-editor.vueのと共通化
|
||||
if (type === 'text') {
|
||||
children.value.push({
|
||||
id,
|
||||
type,
|
||||
text: '',
|
||||
});
|
||||
} else if (type === 'section') {
|
||||
children.value.push({
|
||||
id,
|
||||
type,
|
||||
title: '',
|
||||
children: [],
|
||||
});
|
||||
} else if (type === 'image') {
|
||||
children.value.push({
|
||||
id,
|
||||
type,
|
||||
fileId: null,
|
||||
});
|
||||
} else if (type === 'note') {
|
||||
children.value.push({
|
||||
id,
|
||||
type,
|
||||
detailed: false,
|
||||
note: null,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -216,13 +216,14 @@ async function add() {
|
||||
if (canceled || type == null) return;
|
||||
|
||||
const id = genId();
|
||||
|
||||
// TODO: page-editor.el.section.vueのと共通化
|
||||
if (type === 'text') {
|
||||
content.value.push({
|
||||
id,
|
||||
type,
|
||||
text: '',
|
||||
});
|
||||
return;
|
||||
} else if (type === 'section') {
|
||||
content.value.push({
|
||||
id,
|
||||
@@ -230,14 +231,12 @@ async function add() {
|
||||
title: '',
|
||||
children: [],
|
||||
});
|
||||
return;
|
||||
} else if (type === 'image') {
|
||||
content.value.push({
|
||||
id,
|
||||
type,
|
||||
fileId: null,
|
||||
});
|
||||
return;
|
||||
} else if (type === 'note') {
|
||||
content.value.push({
|
||||
id,
|
||||
@@ -245,7 +244,6 @@ async function add() {
|
||||
detailed: false,
|
||||
note: null,
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user