reload value when late change

This commit is contained in:
2023-07-01 19:36:55 +10:00
parent b322a405c7
commit 5b1d02e3c1

View File

@@ -51,98 +51,12 @@ const handleChange = (newValue) => {
}, 50);
};
const tinyeditor = ref(null);
// const editorContent = ref(props.modelValue);
/* Updating value */
// const handleInitialContentChange = (newContent) => {
// newContent = newContent === undefined ? "" : newContent;
// editorContent.value = newContent;
// };
// const initialContent = computed(() => {
// return props.modelValue;
// });
// watch(initialContent, handleInitialContentChange);
// const handleBlur = (event) => {
// emits("blur", event);
// };
// const handleFocus = (event) => {
// emits("focus", event);
// };
// const handleChange = (event, editor) => {
// emits("update:modelValue", editor.getContent());
// };
// const fetchLinkList = () => {
// const buildPageList = (
// pageList,
// routeEntries,
// prefix_url = "",
// prefix_title = ""
// ) => {
// routeEntries.forEach((entry) => {
// if (
// "path" in entry &&
// entry.path.includes(":") == false &&
// "meta" in entry &&
// "title" in entry.meta &&
// ("hideInEditor" in entry.meta == false ||
// entry.meta.hideInEditor == false) &&
// ("middleware" in entry.meta == false ||
// ("showInEditor" in entry.meta == true &&
// entry.meta.showInEditor == true))
// ) {
// const sep = entry.path.substring(0, 1) == "/" ? "" : "/";
// pageList[prefix_url + sep + entry.path] =
// prefix_title.length > 0
// ? `${prefix_title} ${sep} ${entry.meta.title}`
// : entry.meta.title.toLowerCase() == "home"
// ? entry.meta.title
// : `Home / ${entry.meta.title}`;
// }
// if ("children" in entry) {
// buildPageList(
// pageList,
// entry.children,
// prefix_url + entry.path,
// prefix_title + (entry.meta?.title || "")
// );
// }
// });
// };
// let pageRoutes: { [key: string]: string } = {};
// buildPageList(pageRoutes, routes);
// const pageList: PageList[] = [];
// for (const [key, value] of Object.entries(pageRoutes)) {
// pageList.push({ title: value, value: key });
// }
// pageList.sort((a, b) => {
// const titleA = a.title.toLowerCase();
// const titleB = b.title.toLowerCase();
// if (titleA < titleB) {
// return -1;
// }
// if (titleA > titleB) {
// return 1;
// }
// return 0;
// });
// return pageList;
// };
watch(
() => props.modelValue,
(newValue) => {
markdown.value = newValue;
}
);
</script>
<style lang="scss">