Fix first local markdown open reload

This commit is contained in:
lix-2026
2026-05-26 16:24:00 +08:00
parent 14fec9ef6a
commit bb17513821
4 changed files with 45 additions and 10 deletions
@@ -25,7 +25,7 @@ pub struct DocumentPaneViewModel {
}
#[component]
fn DocumentPane(model: DocumentPaneViewModel) -> impl IntoView {
pub(super) fn DocumentPane(model: DocumentPaneViewModel) -> impl IntoView {
let pane_hidden = !model.visible;
let pane_role = model.pane_role.to_string();
let pane_role_attr = pane_role.clone();
+20 -9
View File
@@ -1,6 +1,9 @@
//! MNOTE 首页组件(Wolai 风格)
use super::layout::PageLayout;
use super::{
document::{DocumentPane, DocumentPaneViewModel},
layout::PageLayout,
};
use leptos::prelude::*;
/// MNOTE 首页。
@@ -61,6 +64,21 @@ pub fn HomePage(
</main>
}.into_any()
} else {
let empty_primary_model = DocumentPaneViewModel {
pane_role: "primary",
title: "文件夹".to_string(),
document_id: String::new(),
workspace_id: workspace_id.clone().unwrap_or_default(),
page_wide_layout: false,
page_small_text: false,
page_layout_density: "normal".to_string(),
page_font: "default".to_string(),
page_show_heading_numbers: false,
has_page_subtree: false,
primary_legacy_ids: true,
visible: true,
hide_title_header: true,
};
view! {
<main
class="document-workspace mnote-workspace-empty-editor-host"
@@ -87,14 +105,7 @@ pub fn HomePage(
</div>
<div class="mnote-main-tab-panels">
<div data-mnote-page-tab-panel="true" data-pane-role="primary">
<section
class="document-pane mnote-workspace-empty-pane"
data-document-pane="true"
data-pane-role="primary"
data-pane-workspace-id={workspace_id.clone().unwrap_or_default()}
data-pane-visible="true"
aria-label="主文档"
></section>
<DocumentPane model={empty_primary_model} />
</div>
<section
class="mnote-resource-tab-host"