fix type
This commit is contained in:
parent
4dcff123df
commit
bd9041bd8f
|
|
@ -74,7 +74,35 @@ async function add() {
|
||||||
if (canceled || type == null) return;
|
if (canceled || type == null) return;
|
||||||
|
|
||||||
const id = genId();
|
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(() => {
|
onMounted(() => {
|
||||||
|
|
|
||||||
|
|
@ -216,13 +216,14 @@ async function add() {
|
||||||
if (canceled || type == null) return;
|
if (canceled || type == null) return;
|
||||||
|
|
||||||
const id = genId();
|
const id = genId();
|
||||||
|
|
||||||
|
// TODO: page-editor.el.section.vueのと共通化
|
||||||
if (type === 'text') {
|
if (type === 'text') {
|
||||||
content.value.push({
|
content.value.push({
|
||||||
id,
|
id,
|
||||||
type,
|
type,
|
||||||
text: '',
|
text: '',
|
||||||
});
|
});
|
||||||
return;
|
|
||||||
} else if (type === 'section') {
|
} else if (type === 'section') {
|
||||||
content.value.push({
|
content.value.push({
|
||||||
id,
|
id,
|
||||||
|
|
@ -230,14 +231,12 @@ async function add() {
|
||||||
title: '',
|
title: '',
|
||||||
children: [],
|
children: [],
|
||||||
});
|
});
|
||||||
return;
|
|
||||||
} else if (type === 'image') {
|
} else if (type === 'image') {
|
||||||
content.value.push({
|
content.value.push({
|
||||||
id,
|
id,
|
||||||
type,
|
type,
|
||||||
fileId: null,
|
fileId: null,
|
||||||
});
|
});
|
||||||
return;
|
|
||||||
} else if (type === 'note') {
|
} else if (type === 'note') {
|
||||||
content.value.push({
|
content.value.push({
|
||||||
id,
|
id,
|
||||||
|
|
@ -245,7 +244,6 @@ async function add() {
|
||||||
detailed: false,
|
detailed: false,
|
||||||
note: null,
|
note: null,
|
||||||
});
|
});
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue