diff --git a/packages/client/app/index.ts b/packages/client/app/index.ts index 9144f7ed..3ac07de8 100644 --- a/packages/client/app/index.ts +++ b/packages/client/app/index.ts @@ -16,9 +16,9 @@ root.plugin(status) root.plugin(styles) root.plugin(theme) -root.app.mount('#app') +root.start() if (!global.static) { const endpoint = new URL(global.endpoint, location.origin).toString() - connect(() => new WebSocket(endpoint.replace(/^http/, 'ws'))) + connect(root, () => new WebSocket(endpoint.replace(/^http/, 'ws'))) } diff --git a/packages/client/app/status/loading.vue b/packages/client/app/status/loading.vue index 951dff19..03865f96 100644 --- a/packages/client/app/status/loading.vue +++ b/packages/client/app/status/loading.vue @@ -14,7 +14,7 @@ import { computed } from 'vue' const ctx = useContext() const progress = computed(() => { - const states = Object.values(ctx.internal.extensions) + const states = Object.values(ctx.$loader.extensions) return states.filter(state => state.done.value).length / states.length }) diff --git a/packages/client/app/theme/activity/index.vue b/packages/client/app/theme/activity/index.vue index 50805313..3bdc12a2 100644 --- a/packages/client/app/theme/activity/index.vue +++ b/packages/client/app/theme/activity/index.vue @@ -21,10 +21,11 @@ import { computed, provide } from 'vue' import { useWindowSize } from '@vueuse/core' -import { activities, Activity, useConfig, useMenu } from '@koishijs/client' +import { Activity, useConfig, useContext, useMenu } from '@koishijs/client' import ActivityItem from './item.vue' import ActivitySeparator from './separator.vue' +const ctx = useContext() const config = useConfig() const trigger = useMenu('theme.activity') const { height, width } = useWindowSize() @@ -34,7 +35,7 @@ const groups = computed(() => { const unit = width.value <= 768 ? 52 : 56 const total = height.value - (width.value <= 768 ? 4 : 8) const available = Object.fromEntries(Object - .entries(activities) + .entries(ctx.$router.pages) .filter(([, data]) => !data.disabled()) .map(([key, data]) => [key, [data]])) for (const id of Object.keys(available)) { diff --git a/packages/client/app/theme/activity/separator.vue b/packages/client/app/theme/activity/separator.vue index 962c8bb3..171d34a8 100644 --- a/packages/client/app/theme/activity/separator.vue +++ b/packages/client/app/theme/activity/separator.vue @@ -12,7 +12,7 @@