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

Modal in a Layout doesn't appear #103

Closed
1 task
SchroterQuentin opened this issue Aug 6, 2018 · 8 comments
Closed
1 task

Modal in a Layout doesn't appear #103

SchroterQuentin opened this issue Aug 6, 2018 · 8 comments
Labels

Comments

@SchroterQuentin
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.0.2

Environment

Windows 10, firefox and chrome, vue 2.5.15, vue-antd-ui 1.0.1

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Didn't succeed to reproduce but I think the error come from the rendering process which is called before some stuff are ready. I already had a similar issue in the past.

What is expected?

I copy past the exemple with modal in my app and in an other clean app and when I click on the button to make the modal visible, the modal does not appear. And the button seems crashed.

What is actually happening?

In the DOM Html where I should have the modal rendered, I juste have

<div><!----></div>

There is nothing displayed on the console and in the vue-dev-tools the components are in a correct state but just not rendered. I'm quite certain that it's a problem of rendering stuff not ready to be rendered.

@tangjinzhou
Copy link
Member

can you give me a Reproduction link?

@SchroterQuentin
Copy link
Author

It's only a problem in development environment. It's just working great on production environment just like the issue I already had but was on the other way.

My old issue was fixed by replacing

var root = new Vue({
    el: "#root",
    template: `<layout/>`,
    components: {
        Layout
    }
})

to

var root = new Vue({
    el: "#root",
    render: h => h(Layout)
})

@SchroterQuentin
Copy link
Author

SchroterQuentin commented Aug 6, 2018

No I can't I try since the last hour but it seems to be not reproducable easily ...

@tangjinzhou
Copy link
Member

give me your code ?

@SchroterQuentin
Copy link
Author

SchroterQuentin commented Aug 6, 2018

I did succeed to reproduce the bug and now I'm quite sure it's about my config on webpack.

Here is the reproductible exemple : https://github.com/SchroterQuentin/Vue-Antd

You will need the dotnet core sdk to build and run the app. When webpack build main.js in dev it's bugged and in prod it's not. If you could explain to me I would really apreciate that.

If I can help I will

@SchroterQuentin
Copy link
Author

I didn't know that, maybe for production purpose I'll remove it but for debug it help me build bundle really fast.
I did find a solution but I do not know why it's working. I just comment this line on my webpack.config.js file

resolve: {
      extensions: ['.js', '.vue'],
      alias: isDevBuild ? {
        // 'vue$': 'vue/dist/vue',
      } : {
      }
},

Thanks for the help. Really appreciate yours quick answers.

@tangjinzhou
Copy link
Member

@SchroterQuentin
I think I know the cause of the problem.
You should ensure that your dll configuration file is consistent with the resolve.alias of the project configuration file.
E.g:

resolve: {
     alias: {
       'vue$': 'vue/dist/vue.esm.js',
     }
   },

@github-actions
Copy link

github-actions bot commented Apr 1, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants