Vuetify可见性课程无法正常工作
遵循文档
使用以下类产生与我要在较大屏幕尺寸上删除元素并将其添加到小元素上的相反的相反。
<span class="d-sm-none d-md-flex">
{{ username }}
</span>
我已经尝试更改此类:
<span class="d-md-none d-lg-flex">
{{ username }}
</span>
但是,这具有相同的效果 - 该元素仅出现在小屏幕上。
如果有人知道为什么这些课程无法正常工作,我将感谢您的帮助。
Following the docs here, I am trying to use a Vuetify visibility class to hide an element on small screens.
Using the following class produces the opposite of what I want removing the element on the larger screen size and adding it to the small one.
<span class="d-sm-none d-md-flex">
{{ username }}
</span>
I have tried changing the classes to this:
<span class="d-md-none d-lg-flex">
{{ username }}
</span>
However, this has the same effect - the element appears only on the small screen.
If anyone has any idea why these classes are not working as expected I would appreciate the help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该添加默认显示屏,在您的情况下,应该是
d-none
而不是d-sm-none
。此元素将在小屏幕上隐藏在中屏设备上的
flex
。You should add a default display, in your case it should be
d-none
instead ofd-sm-none
.This element will be
hidden
on small screens andflex
on medium screen devices.将默认显示器设置为
无
,将其他设备屏幕屏幕设置为block
。Set a the default display to
none
, and the other device screens toblock
.我根据此创建了一个示例工作代码段/演示。
I created a sample working code snippet/demo as per this document and it's working fine.