Skip to content

Commit

Permalink
refactor(webui): move overlay to plugin-chat
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Apr 10, 2021
1 parent 6089379 commit 8735b3b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion packages/plugin-chat/client/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { router } from 'koishi-plugin-webui/client'
import { router, views } from 'koishi-plugin-webui/client'
import Chat from './chat.vue'
import Sandbox from './sandbox.vue'
import Overlay from './overlay.vue'

views.push(Overlay)

router.addRoute({
path: '/sandbox',
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion packages/plugin-webui/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

/// <reference types="./global"/>

import { ref, watch, reactive, Ref } from 'vue'
import { ref, watch, reactive, Ref, Component } from 'vue'
import { createRouter, createWebHistory } from 'vue-router'
import type { User } from 'koishi-core'
import type { Registry, Profile, Meta, Statistics } from '~/server'
import * as client from '~/client'

export const views: Component[] = []

export const store = reactive({
showOverlay: false,
overlayImage: null as HTMLImageElement,
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-webui/client/views/layout/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
<router-view v-else-if="loaded"/>
<p v-else>正在加载数据……</p>
</main>
<overlay/>
<component v-for="view in views" :is="view"/>
</template>

<script lang="ts" setup>
import * as client from '~/client'
import { views } from '~/client'
import Navbar from './navbar.vue'
import Sidebar from './sidebar.vue'
import Overlay from './overlay.vue'
import { computed } from 'vue'
import { useRoute } from 'vue-router'
Expand Down

0 comments on commit 8735b3b

Please sign in to comment.