@aibai/create-myvue 0.0.1 → 0.0.3

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.
@@ -0,0 +1,18 @@
1
+ AutoImport({
2
+ include: [
3
+ /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
4
+ /\.vue$/,
5
+ /\.vue\?vue/ // .vue
6
+ ],
7
+ imports: [
8
+ 'vue',
9
+ 'vue-router',
10
+ 'pinia'
11
+ ],
12
+ dts: 'src/types/auto-import.d.ts',
13
+ eslintrc: {
14
+ enabled: true,
15
+ filepath: './.eslintrc-auto-import.json',
16
+ globalsPropValue: true,
17
+ },
18
+ }),
@@ -0,0 +1 @@
1
+ import Components from 'unplugin-vue-components/vite'
@@ -0,0 +1,6 @@
1
+ Components({
2
+ dirs: ['src/components'],
3
+ extensions: ['vue'],
4
+ dts: 'src/types/auto-components.d.ts',
5
+ resolvers: []
6
+ }),
@@ -0,0 +1,27 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue';
3
+
4
+ const props = defineProps({
5
+ prefix: { type: String, default: 'icon', },
6
+ iconName: { type: String, required: true, },
7
+ color: { type: String, default: '' }
8
+ })
9
+
10
+ const symbolId = computed(() => '#' + props.prefix + '-' + props.iconName);
11
+ </script>
12
+
13
+ <template>
14
+ <svg aria-hidden="true" class="svg-icon">
15
+ <use :xlink:href="symbolId" :fill="color" />
16
+ </svg>
17
+ </template>
18
+
19
+ <style>
20
+ .svg-icon {
21
+ width: 1em;
22
+ height: 1em;
23
+ vertical-align: -0.15em;
24
+ overflow: hidden;
25
+ fill: currentColor;
26
+ }
27
+ </style>
@@ -0,0 +1 @@
1
+ import 'virtual:svg-icons-register';
@@ -0,0 +1 @@
1
+ import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
@@ -0,0 +1,6 @@
1
+ createSvgIconsPlugin({
2
+ // 指定需要缓存的图标文件夹
3
+ iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
4
+ // 指定symbolId格式
5
+ symbolId: 'icon-[dir]-[name]',
6
+ }),