From 74db8ad5ee688c16b4a2d267662f7b40193381de Mon Sep 17 00:00:00 2001 From: jxxghp Date: Fri, 9 Feb 2024 07:27:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=5F=5Finit=5F=5F.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/categoryeditor/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/categoryeditor/__init__.py b/plugins/categoryeditor/__init__.py index bd67ead..f533c2d 100644 --- a/plugins/categoryeditor/__init__.py +++ b/plugins/categoryeditor/__init__.py @@ -27,7 +27,7 @@ class CategoryEditor(_PluginBase): # 私有属性 _enabled = False - _yaml_content = "" + _content = "" user_yaml = settings.CONFIG_PATH / "category.yaml" default_yaml = settings.INNER_CONFIG_PATH / "category.yaml" @@ -35,10 +35,10 @@ class CategoryEditor(_PluginBase): def init_plugin(self, config: dict = None): if config: self._enabled = config.get("enabled") - self._yaml_content = config.get("yaml_content") or "" + self._content = config.get("content") or "" # 写入文件 if self._enabled: - self.user_yaml.write_text(self._yaml_content, encoding="utf-8") + self.user_yaml.write_text(self._content, encoding="utf-8") if not settings.LIBRARY_CATEGORY: self.systemmessage.put("二级分类未开启,策略已保存但未生效!") return @@ -97,7 +97,7 @@ class CategoryEditor(_PluginBase): { 'component': 'VAceEditor', 'props': { - 'modelvalue': 'yaml_content', + 'modelvalue': 'content', 'lang': 'yaml', 'theme': 'monokai', 'style': 'height: 30rem', @@ -111,7 +111,7 @@ class CategoryEditor(_PluginBase): } ], { "enabled": False, - "yaml_content": self.default_yaml.read_text(encoding="utf-8") + "content": self.default_yaml.read_text(encoding="utf-8") } def get_page(self) -> List[dict]: