@yunlefun/vue 0.0.6 → 0.0.8-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -4
- package/components/YlfBottomMenuItem.vue +1 -1
- package/components/YlfCard.vue +9 -0
- package/components/bottom-menu/demo.vue +6 -1
- package/components/card/demo.vue +5 -0
- package/components/card/index.md +4 -0
- package/components/common/demo.vue +3 -0
- package/components/common/index.md +4 -0
- package/dist/index.d.cts +25 -0
- package/dist/index.d.mts +25 -0
- package/dist/index.d.ts +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
# @yunlefun/vue
|
|
1
|
+
# @yunlefun/vue
|
|
2
|
+
|
|
3
|
+
Vue toolkit(components/composables) for YunLeFun.
|
|
2
4
|
|
|
3
5
|
## Usage
|
|
4
6
|
|
|
5
7
|
```bash
|
|
6
|
-
pnpm add -D @yunlefun/vue
|
|
8
|
+
pnpm add -D @yunlefun/vue
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Use it in Nuxt
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
export default defineNuxtConfig({
|
|
15
|
+
modules: [
|
|
16
|
+
// ...
|
|
17
|
+
'@vueuse/nuxt',
|
|
18
|
+
'@unocss/nuxt',
|
|
19
|
+
'@pinia/nuxt',
|
|
20
|
+
// add this line
|
|
21
|
+
'@yunlefun/vue/nuxt',
|
|
22
|
+
],
|
|
23
|
+
})
|
|
7
24
|
```
|
|
8
25
|
|
|
9
26
|
### Add auto import resolver for vue components
|
|
@@ -11,19 +28,22 @@ pnpm add -D @yunlefun/vue-components
|
|
|
11
28
|
```ts
|
|
12
29
|
// vite.config.ts
|
|
13
30
|
import { defineConfig } from 'vite'
|
|
14
|
-
import { componentsDir } from '@yunlefun/vue-components'
|
|
15
31
|
import Components from 'unplugin-vue-components/vite'
|
|
16
32
|
|
|
17
33
|
export default defineConfig({
|
|
18
34
|
plugins: [
|
|
19
35
|
// https://github.com/antfu/unplugin-vue-components
|
|
20
36
|
Components({
|
|
21
|
-
dirs: ['src/components', componentsDir],
|
|
22
37
|
// allow auto load markdown components under `./src/components/`
|
|
23
38
|
extensions: ['vue', 'md'],
|
|
24
39
|
// allow auto import and register components used in markdown
|
|
25
40
|
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
|
|
26
41
|
dts: 'src/components.d.ts',
|
|
42
|
+
resolvers: [
|
|
43
|
+
// add @yunlefun/vue auto import resolver
|
|
44
|
+
YlfResolver(),
|
|
45
|
+
],
|
|
46
|
+
di
|
|
27
47
|
}),
|
|
28
48
|
]
|
|
29
49
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import type { BottomMenuItem } from '@yunlefun/vue
|
|
2
|
+
import type { BottomMenuItem } from '@yunlefun/vue'
|
|
3
3
|
import { ref } from 'vue'
|
|
4
4
|
|
|
5
5
|
const items: BottomMenuItem[] = [
|
|
@@ -23,8 +23,13 @@ const items: BottomMenuItem[] = [
|
|
|
23
23
|
},
|
|
24
24
|
]
|
|
25
25
|
|
|
26
|
+
// when using vue-router
|
|
27
|
+
// import { useRouter } from 'vue-router'
|
|
28
|
+
// const router = useRouter()
|
|
29
|
+
// const active = computed(() => router.currentRoute.value.path)
|
|
26
30
|
const active = ref('/')
|
|
27
31
|
function onClick(item: BottomMenuItem) {
|
|
32
|
+
// router.push(item.to)
|
|
28
33
|
active.value = item.to || ''
|
|
29
34
|
}
|
|
30
35
|
</script>
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface BottomMenuItem {
|
|
2
|
+
title: string;
|
|
3
|
+
/**
|
|
4
|
+
* @description icon class
|
|
5
|
+
*/
|
|
6
|
+
icon: string;
|
|
7
|
+
/**
|
|
8
|
+
* @description active icon class
|
|
9
|
+
*/
|
|
10
|
+
activeIcon?: string;
|
|
11
|
+
/**
|
|
12
|
+
* @description RouterLink to
|
|
13
|
+
*/
|
|
14
|
+
to?: string;
|
|
15
|
+
/**
|
|
16
|
+
* onClick
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare const _dirname: string;
|
|
23
|
+
declare const componentsDir: string;
|
|
24
|
+
|
|
25
|
+
export { type BottomMenuItem, _dirname, componentsDir };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface BottomMenuItem {
|
|
2
|
+
title: string;
|
|
3
|
+
/**
|
|
4
|
+
* @description icon class
|
|
5
|
+
*/
|
|
6
|
+
icon: string;
|
|
7
|
+
/**
|
|
8
|
+
* @description active icon class
|
|
9
|
+
*/
|
|
10
|
+
activeIcon?: string;
|
|
11
|
+
/**
|
|
12
|
+
* @description RouterLink to
|
|
13
|
+
*/
|
|
14
|
+
to?: string;
|
|
15
|
+
/**
|
|
16
|
+
* onClick
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare const _dirname: string;
|
|
23
|
+
declare const componentsDir: string;
|
|
24
|
+
|
|
25
|
+
export { type BottomMenuItem, _dirname, componentsDir };
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yunlefun/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.8-beta.0",
|
|
5
5
|
"description": "Components for YunLeFun",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./components/*": "./components/*",
|
|
8
8
|
"./nuxt": "./nuxt.js",
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.cjs"
|
|
13
13
|
},
|
|
14
14
|
"./*": "./*"
|
|
15
15
|
},
|