Skip to content

Commit 6dc04f3

Browse files
committed
feat(chat): refactor chat plugin
1 parent 8debcd1 commit 6dc04f3

21 files changed

+86
-1192
lines changed

packages/chat/.npmignore

-2
This file was deleted.

packages/chat/client/chat.vue

-234
This file was deleted.

packages/chat/client/icons/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { icons } from '@koishijs/client'
2-
import Comments from './comments.vue'
1+
import { icons } from '@cordisjs/client'
2+
import Activity from './activity.vue'
33

4-
icons.register('activity:comments', Comments)
4+
icons.register('activity:chat', Activity)

packages/chat/client/index.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
import { Context } from '@koishijs/client'
2-
import Chat from './chat.vue'
1+
import { Context } from '@cordisjs/client'
2+
import {} from '../src'
3+
import Chat from './index.vue'
34
import './icons'
45

56
export default (ctx: Context) => {
67
ctx.page({
78
path: '/chat',
89
name: '聊天',
9-
icon: 'activity:comments',
10-
authority: 3,
11-
fields: ['chat'],
12-
component: Chat,
10+
icon: 'activity:chat',
1311
order: 100,
12+
component: Chat,
1413
})
1514

1615
ctx.menu('chat.message', [{

packages/chat/client/index.vue

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<template>
2+
<k-layout>
3+
<template #left>
4+
<div class="flex px-4 py-2 gap-x-4 justify-between" v-for="guild in data.guilds" :key="guild.id">
5+
<img class="b-rd-full" :src="guild.avatar" width="48" height="48"/>
6+
<div class="flex flex-col flex-1">
7+
<div>{{ guild.name }}</div>
8+
<div>{{ guild.id }}</div>
9+
</div>
10+
</div>
11+
</template>
12+
</k-layout>
13+
</template>
14+
15+
<script lang="ts" setup>
16+
17+
import { onMounted, ref, computed, watch, reactive } from 'vue'
18+
import { useRpc } from '@cordisjs/client'
19+
import type { Data } from '../src'
20+
21+
const data = useRpc<Data>()
22+
23+
</script>
24+
25+
<style lang="scss" scoped>
26+
27+
</style>

packages/chat/client/member.vue

-56
This file was deleted.

0 commit comments

Comments
 (0)