Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report]does not provide an export named 'default' #380

Open
343058360 opened this issue Jul 29, 2024 · 1 comment
Open

[Bug Report]does not provide an export named 'default' #380

343058360 opened this issue Jul 29, 2024 · 1 comment
Labels
Bug Something isn't working

Comments

@343058360
Copy link

Environment

windows11 / chrom127 / vue3

Reproduction link

https://github.com/view-design/view-ui-project-nuxt

Steps to reproduce

pnpm install --shamefully-hoist

What is expected?

正确使用iview-ui-plus

What is actually happening?

无法使用

@dosubot dosubot bot added the Bug Something isn't working label Jul 29, 2024
Copy link

dosubot bot commented Jul 29, 2024

To resolve the import issue with the ViewUIPlus library in your Vue 3 project, you need to ensure that you are importing the library correctly since it does not provide a default export. You should import it as a named import. Here is how you can do it:

import { createApp } from 'vue';
import { createRouter, createWebHistory } from 'vue-router';
import App from './app.vue';
import { install as ViewUIPlus } from 'view-ui-plus'; // Use named import

const router = createRouter({
    esModule: false,
    mode: 'history',
    history: createWebHistory(),
    routes: [
        // your routes here
    ]
});

const app = createApp(App);
app.use(ViewUIPlus); // Use the named import directly
app.use(router);
app.mount('#app');
export default app;

This approach ensures that you are correctly importing and using the ViewUIPlus library in your project. For more details, you can refer to the similar issue here.

To continue talking to Dosu, mention @dosu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant