opentiny / tiny-vue

TinyVue is an enterprise-class UI component library of OpenTiny community, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.
https://opentiny.design/tiny-vue
MIT License
1.42k stars 233 forks source link

🐛 [Bug]: autoImportPlugin 自动导入,影响了全局组件挂载 #1505

Open zdz23 opened 3 months ago

zdz23 commented 3 months ago

Version

3.14.0

Vue Version

vue3

Link to minimal reproduction

nothing

Step to reproduce

vite.config.js 代码 import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import path from 'path' import AutoImport from 'unplugin-auto-import/vite' import autoImportPlugin from '@opentiny/unplugin-tiny-vue' import importPlugin from '@opentiny/vue-vite-import'

export default defineConfig({ plugins: [ vue(), autoImportPlugin(), AutoImport({ imports: ['vue', 'pinia', 'vue-router'], dts: false }), importPlugin( [ { libraryName: '@opentiny/vue' }, { libraryName: @opentiny/vue-icon, customName: (name) => { return @opentiny/vue-icon/lib/${name.replace(/^icon-/, '')}.js } } ], 'pc' // 此配置非必选,按需配置(pc|mobile|mobile-first) ) ], resolve: { // https://cn.vitejs.dev/config/#resolve-alias alias: { // 设置路径 '~': path.resolve(dirname, './'), // 设置别名 '@': path.resolve(dirname, './src') }, // https://cn.vitejs.dev/config/#resolve-extensions extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'] }, define: { 'process.env': { ...process.env } } })

App.vue 代码

运行后,提示 router-view not find

What is expected

No response

What is actually happening

No response

What is your project name

练习的项目

Any additional comments (optional)

No response

Issues-translate-bot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: 🐛 [Bug]: autoImportPlugin is automatically imported, affecting global component mounting

xakoy commented 3 months ago

same question