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

单独某个页面不使用统一的布局或者一个站点中可以同时使用多个布局的形式,如登陆页面中不想要导航信息(通过配置隐藏或者提供多入口形式) #119

Open
GeekSRE opened this issue Apr 13, 2020 · 2 comments

Comments

@GeekSRE
Copy link

GeekSRE commented Apr 13, 2020

单独某个页面不使用统一的布局或者一个站点中可以同时使用多个布局的形式,如登陆页面中不想要导航信息(通过配置隐藏或者提供多入口形式)

Originally posted by @darrenywyu in #67 (comment)

我创建了一个 form表单,我现在想让表单居中,不显示header ,请问大神 如何隐藏配置。谢谢。

<script> export default { name: 'login-form-form', data() { const self = this; return { items: [{ name: 'username', title: '用户名', type: 'input', placeholder: '输入LDAP账号', required: true, width: '400px' }, { name: 'password', title: '密码', type: 'input', types: 'password', required: true, placeholder: '输入LDAP密码', width: '400px' }, ], action: [ { name: 'submit', type: 'primary', title: '登录', submitUrl: 'http://0.0.0.0:8000/api/login', args: {}, callback() { self.$Message.success('提交成功'); } } ] }; }, methods: { } }; </script> <style lang="less"> .user-login {} </style>
@iyuxy
Copy link
Collaborator

iyuxy commented Apr 14, 2020

目前不支持配置,可以在表单页面中加入如下2个钩子函数,注意:钩子函数和methods、data(){...}是同一层级的。

created() {
    document.querySelector('.noahv-layout-header').style.display = 'none';
    document.querySelector('.noahv-layout-sidebar-root').style.display = 'none';
},
beforeDestroy() {
    document.querySelector('.noahv-layout-header').style.display = 'block';
    document.querySelector('.noahv-layout-sidebar-root').style.display = 'block';
}

@YYYSSSHHH
Copy link

用钩子函数试了一下,还是小点问题: 如果页面A首次被打开,header还是存在,当从页面A到页面B,然后再回到当前页面A时,header才会消失。 大佬@iyuxy,是否有办法,在第一次打开时,也让header消失呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants