imengyu / vue-code-layout

Vue 仿 VSCode 布局组件 A Vue editor layout component that like VSCode and can be used to develop web editors.
https://docs.imengyu.top/vue-code-layout-docs/
MIT License
31 stars 4 forks source link

Panels not displayed #8

Open Donald2010 opened 2 weeks ago

Donald2010 commented 2 weeks ago

I cloned codelayout and vue3-context-menu component in my project, and copied examples/views/BasicUseage.vue, just made some modification with regards to paths of components and assets. when run my project , the layout is displayed, but panels are all empty. What may be the reason, is there something like .css file missed ?

The page displayed as the following image1 whith horrizon scrollbar when primary sidebar is toggled on , scroll1

and the page is displayed as the following image2 whithout horrizon scrollbar when primary sidebar is toggle off, scroll2

The source of basicusage.vue is almost same as in example, basicusage1 basicusage2

imengyu commented 2 weeks ago

Try add the CSS code below:

.full-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

If the height of the container is not defined, the layout component will not be able to calculate the appropriate height, so it will be displayed as 0px height, which means it cannot be seen

Snipaste_2024-10-16_17-46-17

Donald2010 commented 2 weeks ago

After adding the style to basicusage.vue,

  <style>
  .full-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }
</style>

and adding a wraper to with style

.test-host {
    margin-top: 10px;
    margin-left: 20px;
    margin-right: 20px;
    height: 86vh;
  }

the sidebar appear, but main panel is still not shown split1

and secondary sidebar is shown only if primary sidebar is toggle off. split2

only if both sidebars are toggled off, the main panel appear split3

imengyu commented 2 weeks ago

I cannot see your code, so I cannot know where the problem is.

You may start with the simplest project and gradually add code

Project example here: https://codesandbox.io/s/s8gq4r

Donald2010 commented 2 weeks ago

My fault. I made wrong configuration. It works well now. Thank you.