feat: localizable dialog title for enter section title (#14401)
* feat: localizable dialog title for enter section title * refactor: define `getPageBlockList` in separated file and import instead of provide/inject
This commit is contained in:
@@ -77,6 +77,7 @@ import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { mainRouter } from '@/router/main.js';
|
||||
import { getPageBlockList } from '@/pages/page-editor/common.js';
|
||||
|
||||
const props = defineProps<{
|
||||
initPageId?: string;
|
||||
@@ -101,7 +102,6 @@ const alignCenter = ref(false);
|
||||
const hideTitleWhenPinned = ref(false);
|
||||
|
||||
provide('readonly', readonly.value);
|
||||
provide('getPageBlockList', getPageBlockList);
|
||||
|
||||
watch(eyeCatchingImageId, async () => {
|
||||
if (eyeCatchingImageId.value == null) {
|
||||
@@ -216,15 +216,6 @@ async function add() {
|
||||
content.value.push({ id, type });
|
||||
}
|
||||
|
||||
function getPageBlockList() {
|
||||
return [
|
||||
{ value: 'section', text: i18n.ts._pages.blocks.section },
|
||||
{ value: 'text', text: i18n.ts._pages.blocks.text },
|
||||
{ value: 'image', text: i18n.ts._pages.blocks.image },
|
||||
{ value: 'note', text: i18n.ts._pages.blocks.note },
|
||||
];
|
||||
}
|
||||
|
||||
function setEyeCatchingImage(img) {
|
||||
selectFile(img.currentTarget ?? img.target, null).then(file => {
|
||||
eyeCatchingImageId.value = file.id;
|
||||
|
Reference in New Issue
Block a user