mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 18:26:05 +08:00
refactor(infra): directory structure (#4615)
This commit is contained in:
17
packages/plugins/vue-hello-world/src/app.vue
Normal file
17
packages/plugins/vue-hello-world/src/app.vue
Normal file
@@ -0,0 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
|
||||
const count = ref(0);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-button @click="count++">
|
||||
{{ count }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.el-button {
|
||||
font-size: 30px;
|
||||
}
|
||||
</style>
|
||||
5
packages/plugins/vue-hello-world/src/global.d.ts
vendored
Normal file
5
packages/plugins/vue-hello-world/src/global.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
declare module '*.vue' {
|
||||
import type { ComponentOptions } from 'vue';
|
||||
const component: ComponentOptions;
|
||||
export default component;
|
||||
}
|
||||
18
packages/plugins/vue-hello-world/src/index.ts
Normal file
18
packages/plugins/vue-hello-world/src/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { PluginContext } from '@affine/sdk/entry';
|
||||
import ElementPlus from 'element-plus';
|
||||
import { createApp } from 'vue';
|
||||
|
||||
import App from './app.vue';
|
||||
|
||||
export const entry = (context: PluginContext) => {
|
||||
context.register('headerItem', div => {
|
||||
const app = createApp(App);
|
||||
app.use(ElementPlus);
|
||||
app.mount(div, false, false);
|
||||
return () => {
|
||||
app.unmount();
|
||||
};
|
||||
});
|
||||
|
||||
return () => {};
|
||||
};
|
||||
Reference in New Issue
Block a user