@yunlefun/vue 0.0.1

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 ADDED
@@ -0,0 +1,32 @@
1
+ # @yunlefun/vue-components
2
+
3
+ ## Usage
4
+
5
+ ```bash
6
+ pnpm add -D @yunlefun/vue-components
7
+ ```
8
+
9
+ ### Add auto import resolver for vue components
10
+
11
+ ```ts
12
+ // vite.config.ts
13
+ import { defineConfig } from 'vite'
14
+ import { componentsDir } from '@yunlefun/vue-components'
15
+ import Components from 'unplugin-vue-components/vite'
16
+
17
+ export default defineConfig({
18
+ plugins: [
19
+ // https://github.com/antfu/unplugin-vue-components
20
+ Components({
21
+ dirs: ['src/components', componentsDir],
22
+ // allow auto load markdown components under `./src/components/`
23
+ extensions: ['vue', 'md'],
24
+ // allow auto import and register components used in markdown
25
+ include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
26
+ dts: 'src/components.d.ts',
27
+ }),
28
+ ]
29
+ })
30
+ ```
31
+
32
+ You can use `<YlfXxx />` components in your vue files directly.
package/dist/index.cjs ADDED
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ const node_path = require('node:path');
4
+ const node_url = require('node:url');
5
+
6
+ const _dirname = typeof __dirname !== "undefined" ? __dirname : node_path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href))));
7
+ const componentsDir = node_path.resolve(_dirname, "../components");
8
+
9
+ exports._dirname = _dirname;
10
+ exports.componentsDir = componentsDir;
@@ -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 { BottomMenuItem, _dirname, componentsDir };
package/dist/index.mjs ADDED
@@ -0,0 +1,7 @@
1
+ import { dirname, resolve } from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+
4
+ const _dirname = typeof __dirname !== "undefined" ? __dirname : dirname(fileURLToPath(import.meta.url));
5
+ const componentsDir = resolve(_dirname, "../components");
6
+
7
+ export { _dirname, componentsDir };
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@yunlefun/vue",
3
+ "type": "module",
4
+ "version": "0.0.1",
5
+ "description": "Components for YunLeFun",
6
+ "exports": {
7
+ "./components/*": "./components/*",
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "require": "./dist/index.cjs",
11
+ "import": "./dist/index.mjs"
12
+ },
13
+ "./*": "./*"
14
+ },
15
+ "main": "./dist/index.cjs",
16
+ "module": "./dist/index.mjs",
17
+ "types": "./dist/index.d.ts",
18
+ "files": [
19
+ "dist",
20
+ "auto-import-resolver.d.ts"
21
+ ],
22
+ "scripts": {
23
+ "build": "unbuild",
24
+ "prepublishOnly": "npm run build",
25
+ "release": "bumpp --no-commit --no-tag --no-push && npm publish",
26
+ "typecheck": "vue-tsc --noEmit"
27
+ },
28
+ "devDependencies": {
29
+ "nuxt": "^3.6.5",
30
+ "unplugin-vue-components": "^0.25.1"
31
+ }
32
+ }