chore: config install according component

This commit is contained in:
Sagi 2022-09-30 15:02:45 +08:00
parent ba863b2c91
commit 5b8165bb38
5 changed files with 51 additions and 27 deletions

View File

@ -0,0 +1,13 @@
import type { App } from 'vue';
import According from './src/according.component';
import AccordingItem from './src/components/according-item.component';
export * from './src/according.props';
export * from './src/components/according-item.props';
export default {
install(app: App): void {
app.component(According.name, According);
app.component(AccordingItem.name, AccordingItem);
}
};

View File

@ -6,7 +6,7 @@ export * from './src/button-edit.props';
export { ButtonEdit };
export default {
install(app: App): void {
app.component(ButtonEdit.name, ButtonEdit);
},
install(app: App): void {
app.component(ButtonEdit.name, ButtonEdit);
}
};

View File

@ -0,0 +1,13 @@
import { defineComponent, SetupContext } from 'vue';
import { TabPageProps, tabPageProps } from './tab-page.props';
export default defineComponent({
name: 'FTabPage',
props: tabPageProps,
emits: [],
setup(props: TabPageProps, context: SetupContext) {
return () => {
return context.slots.default && context.slots.default();
};
}
});

View File

@ -1,7 +1,7 @@
{
"name": "@farris/ui-vue",
"private": true,
"version": "0.0.0",
"version": "0.0.1",
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",

View File

@ -1,38 +1,36 @@
<script setup lang="ts">
import { ref } from 'vue'
import { ref } from 'vue';
defineProps<{ msg: string }>()
defineProps<{ msg: string }>();
const count = ref(0)
const count = ref(0);
</script>
<template>
<h1>{{ msg }}</h1>
<h1>{{ msg }}</h1>
<div class="card">
<button type="button" @click="count++">count is {{ count }}</button>
<p>
Edit
<code>components/HelloWorld.vue</code> to test HMR
</p>
</div>
<div class="card">
<button type="button" @click="count++">count is {{ count }}</button>
<p>
Edit
<code>components/HelloWorld.vue</code> to test HMR
Check out
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank">create-vue</a>, the official Vue + Vite starter
</p>
</div>
<p>
Check out
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
>create-vue</a
>, the official Vue + Vite starter
</p>
<p>
Install
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
in your IDE for a better DX
</p>
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
<p>
Install
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
in your IDE for a better DX
</p>
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
</template>
<style scoped>
.read-the-docs {
color: #888;
color: #888;
}
</style>