diff --git a/src/assets/scss/_tailwind.scss b/src/assets/css/tailwind.css similarity index 100% rename from src/assets/scss/_tailwind.scss rename to src/assets/css/tailwind.css diff --git a/src/assets/scss/style.scss b/src/assets/scss/style.scss index 9e43130d..d9fffe08 100644 --- a/src/assets/scss/style.scss +++ b/src/assets/scss/style.scss @@ -1,2 +1 @@ -@import './tailwind'; @import './common'; diff --git a/src/components/common/TopHeader.vue b/src/components/common/TopHeader.vue index c9b22e2a..e9cd3ed6 100644 --- a/src/components/common/TopHeader.vue +++ b/src/components/common/TopHeader.vue @@ -5,11 +5,18 @@ - + + +
+ {{ + $t('common.button.login') + }} +
+
@@ -36,6 +43,11 @@ export default defineComponent({ this.$router.push({ name: 'home' }); + }, + onLogin() { + this.$router.push({ + name: 'login' + }); } } }); diff --git a/src/i18n/zh/common/button.ts b/src/i18n/zh/common/button.ts index 389051a2..5bad98ad 100644 --- a/src/i18n/zh/common/button.ts +++ b/src/i18n/zh/common/button.ts @@ -1,4 +1,5 @@ export default { setup: '配置', - edit: '编辑' + edit: '编辑', + login: '登录' }; diff --git a/src/layouts/Auth.vue b/src/layouts/Auth.vue new file mode 100644 index 00000000..8278e7a8 --- /dev/null +++ b/src/layouts/Auth.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/libs/vditor/ts/toolbar/EditMode.ts b/src/libs/vditor/ts/toolbar/EditMode.ts index 273f20d7..b58e3fbe 100644 --- a/src/libs/vditor/ts/toolbar/EditMode.ts +++ b/src/libs/vditor/ts/toolbar/EditMode.ts @@ -160,9 +160,10 @@ export class EditMode extends MenuItem { const panelElement = document.createElement('div'); this.panelElement = panelElement; panelElement.className = `vditor-hint${menuItem.level === 2 ? '' : ' vditor-panel--arrow'}`; - panelElement.innerHTML = ` + // panelElement.innerHTML = ` + panelElement.innerHTML = ` `; @@ -175,21 +176,21 @@ export class EditMode extends MenuItem { const actionBtn = this.element.children[0] as HTMLElement; toggleSubMenu(vditor, panelElement, actionBtn, menuItem.level); - this.panelElement.children.item(0).addEventListener(getEventName(), (event: Event) => { - // wysiwyg - setEditMode(vditor, 'wysiwyg', event); - event.preventDefault(); - event.stopPropagation(); - }); + // this.panelElement.children.item(0).addEventListener(getEventName(), (event: Event) => { + // // wysiwyg + // setEditMode(vditor, 'wysiwyg', event); + // event.preventDefault(); + // event.stopPropagation(); + // }); - this.panelElement.children.item(1).addEventListener(getEventName(), (event: Event) => { + this.panelElement.children.item(0).addEventListener(getEventName(), (event: Event) => { // ir setEditMode(vditor, 'ir', event); event.preventDefault(); event.stopPropagation(); }); - this.panelElement.children.item(2).addEventListener(getEventName(), (event: Event) => { + this.panelElement.children.item(1).addEventListener(getEventName(), (event: Event) => { // markdown setEditMode(vditor, 'sv', event); event.preventDefault(); diff --git a/src/main.ts b/src/main.ts index 70f82120..1b8ebcb3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,6 +4,7 @@ import router from './router/index'; import store from './store/index'; import ElementPlus from 'element-plus'; import i18n from './i18n/index'; +import './assets/css/tailwind.css'; import './assets/scss/style.scss'; import 'element-plus/dist/index.css'; diff --git a/src/pages/auth/Login.vue b/src/pages/auth/Login.vue new file mode 100644 index 00000000..83625bd1 --- /dev/null +++ b/src/pages/auth/Login.vue @@ -0,0 +1,23 @@ + + + + diff --git a/src/router/auth.ts b/src/router/auth.ts new file mode 100644 index 00000000..92f806bd --- /dev/null +++ b/src/router/auth.ts @@ -0,0 +1,20 @@ +import { t } from '../i18n'; + +export default { + path: '/auth', + name: 'auth', + meta: { + title: t('common.nav.content') + }, + component: () => import('@/layouts/Auth.vue'), + children: [ + { + path: 'login', + name: 'auth-login', + meta: { + title: t('common.nav.article') + }, + component: () => import('@/pages/auth/Login.vue') + } + ] +}; diff --git a/src/router/index.ts b/src/router/index.ts index 51102de4..29d7dc00 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,5 +1,6 @@ import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'; import content from './content'; +import auth from './auth'; const routes = [ { @@ -9,7 +10,8 @@ const routes = [ name: 'article-index' } }, - content + content, + auth ]; const router = createRouter({