|
@@ -25,6 +25,7 @@ import { useModel } from '@zjxpcyc/vue-tiny-store'
|
25
|
25
|
import ContextMenu from '@/components/ContextMenu.vue';
|
26
|
26
|
import SubMenu from '@/components/SubMenu.vue';
|
27
|
27
|
import eventBus from '@/utils/eventBus'
|
|
28
|
+import { appendSuffix } from '@/utils/file';
|
28
|
29
|
|
29
|
30
|
const props = defineProps({
|
30
|
31
|
menuStyle: {
|
|
@@ -63,9 +64,9 @@ const handleOpenChange = (keys) => {
|
63
|
64
|
// 创建新文件
|
64
|
65
|
const createNewFile = ({ menu: parentMenu, name: newFileName }) => {
|
65
|
66
|
const parentPath = parentMenu ? parentMenu.path : ''
|
66
|
|
- const newFilePath = parentPath ? `${parentPath}/${newFileName}.html` : `${newFileName}.html`
|
|
67
|
+ const newFilePath = parentPath ? `${parentPath}/${newFileName}` : newFileName
|
67
|
68
|
|
68
|
|
- newNote(user, newFilePath, repo)
|
|
69
|
+ newNote(user, appendSuffix(newFilePath), repo)
|
69
|
70
|
}
|
70
|
71
|
|
71
|
72
|
// 创建新目录
|