gemercheung пре 7 месеци
родитељ
комит
8684165da1

+ 4 - 1
packages/frontend/package.json

@@ -1,5 +1,5 @@
 {
-  "name": "vue-naive-admin",
+  "name": "@4dkankan/helperfrontend",
   "type": "module",
   "version": "2.0.0",
   "private": true,
@@ -13,15 +13,18 @@
   },
   "dependencies": {
     "@arco-design/color": "^0.4.0",
+    "@codecoderun/vivid": "^0.0.23",
     "@vueuse/core": "^12.0.0",
     "axios": "^1.7.9",
     "cherry-markdown": "^0.8.57",
     "dayjs": "^1.11.13",
     "echarts": "^5.5.1",
+    "katex": "^0.16.19",
     "lodash-es": "^4.17.21",
     "naive-ui": "^2.40.3",
     "pinia": "^2.3.0",
     "pinia-plugin-persistedstate": "^4.1.3",
+    "remixicon": "^4.6.0",
     "vue": "^3.5.13",
     "vue-echarts": "^7.0.3",
     "vue-router": "^4.5.0",

+ 10 - 23
packages/frontend/src/views/article/add.vue

@@ -1,42 +1,29 @@
 <template>
   <CommonPage show-footer>
     <template #action>
-      <NButton type="primary" @click="router.push('article/add')">
-        <i class="i-material-symbols:add mr-4 text-18" />
-        创建新文章
+      <NButton type="primary" @click="handleAdd">
+        保存文章
       </NButton>
     </template>
 
     <!-- <n-space size="large"> -->
-    <div style="min-height: 500px;">
-      <div id="markdown-container" />
+    <div class="editor-wrap">
+      <VividEditor v-model:value="data" :dark="true" />
     </div>
+
     <!-- </n-space> -->
   </CommonPage>
 </template>
 
 <script setup>
-import { router } from '@/router'
-import Cherry from 'cherry-markdown'
-import { NButton } from 'naive-ui'
-import { onMounted } from 'vue'
-import 'cherry-markdown/dist/cherry-markdown.css'
+import { VividEditor } from '@codecoderun/vivid'
+import { ref } from 'vue'
 
 const articleValue = ref('')
-
+const data = ref('')
 onMounted(() => {
-  const cherryInstance = new Cherry({
-    id: 'markdown-container',
-    value: articleValue.value,
-    editor: {
-      theme: 'default',
-      height: '100%',
-      defaultModel: '',
-    },
-  })
-
-  console.log('cherryInstance', cherryInstance)
+  console.log('VividEditor', VividEditor)
 })
 
-// function handleAdd() {}
+function handleAdd() { }
 </script>

+ 1 - 0
packages/frontend/src/views/category/index.vue

@@ -173,4 +173,5 @@ async function handleEnable(row) {
 
 const allCategory = ref([])
 api.getAll().then(({ data = [] }) => (allCategory.value = data.map(item => ({ label: item.title, value: item.id }))))
+
 </script>

Разлика између датотеке није приказан због своје велике величине
+ 1265 - 0
pnpm-lock.yaml