- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我将 vue 与 vue-material 一起使用.
我目前正在使用 md-app
布置我的 Web 应用程序的主要结构。作为 md-[app-]drawer
的根目录, md-[app-]toolbar
和 md-[app-]content
.
如果我将这些组件直接放在 md-app
中标签,他们工作。这看起来像这样:
<template>
<div class="md-layout-row">
<md-app>
<md-drawer>
<md-list>
<md-list-item>
<md-icon>people</md-icon>
<span class="md-list-item-text">Foo</span>
</md-list-item>
<md-list-item>
<md-icon>view_list</md-icon>
<span class="md-list-item-text">Bar</span>
</md-list-item>
</md-list>
</md-drawer>
</md-app>
</div>
</template>
但出于设计目的,我尝试将每个内部部分(在本例中为 md-drawer
标签)提取到自己的 vue 组件中。
我有我的 Drawer
现在组件,它看起来像这样:
<template>
<md-drawer>
<md-list>
<md-list-item>
<md-icon>people</md-icon>
<span class="md-list-item-text">Foo</span>
</md-list-item>
<md-list-item>
<md-icon>view_list</md-icon>
<span class="md-list-item-text">Bar</span>
</md-list-item>
</md-list>
</md-drawer>
</template>
..还有我的md-app
(在导入组件 ofc 之后)现在看起来像这样:
<template>
<div class="md-layout-row">
<md-app>
<MyDrawer />
</md-app>
</div>
</template>
但这根本不会渲染抽屉。为什么是这样? Vue 是否额外包装组件可能会混淆 vue-material 的 css?有没有办法绕过/解决这个问题? .. 还是我只是用错了方式?
经过一些实验,我发现如果环绕 MyDrawer
是可行的带有 md-[app-]content
的标签标记,但这不会导致我正在寻找的布局。
我猜 md-app
正在专门寻找这些组件,因为它不知道如何处理 MyDrawer
标记它只是忽略它?虽然MyDrawer
本质上是一个 md-drawer
标记/组件?
我一直在阅读 DOM Template Parsing Caveats ,我认为这应该可行,但我还没有取得任何成功。我刚刚声明了一个 <md-drawer is="MyDrawer" />
标记并移除主包装 md-drawer
来自 MyDrawer
的标签组件
最佳答案
md-active - type = Boolean. Option used to trigger the drawer visibility. Should be used with the .sync modifier. Default = false
用于 Drawer
的示例:
<md-drawer :md-active.sync="showNavigation">
...
</md-drawer>
md-app
不正确。见Component-Naming-Conventions 用于 md-app
的示例:
<md-app>
<my-drawer />
</md-app>
*注意 但在使用之前请看下一个答案
Any other tag passed as a direct child of the md-app tag will be ignored. The component will only look for those three tags and choose the right placement for them. Documentation
用于 md-app
的示例:
<md-app md-waterfall md-mode="fixed-last">
<md-app-toolbar class="md-large md-dense md-primary">
<div class="md-toolbar-row">
<div class="md-toolbar-section-start">
<md-button class="md-icon-button" @click="menuVisible = !menuVisible">
<md-icon>menu</md-icon>
</md-button>
<span class="md-title">My Title</span>
</div>
<div class="md-toolbar-section-end">
<md-button class="md-icon-button">
<md-icon>more_vert</md-icon>
</md-button>
</div>
</div>
<div class="md-toolbar-row">
<md-tabs class="md-primary">
<md-tab id="tab-home" md-label="Home"></md-tab>
<md-tab id="tab-pages" md-label="Pages"></md-tab>
</md-tabs>
</div>
</md-app-toolbar>
<md-app-drawer :md-active.sync="menuVisible">
<md-toolbar class="md-transparent" md-elevation="0">Navigation</md-toolbar>
<md-list>
<md-list-item>
<md-icon>move_to_inbox</md-icon>
<span class="md-list-item-text">Inbox</span>
</md-list-item>
</md-list>
</md-app-drawer>
<md-app-content>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</p>
</md-app-content>
</md-app>
is
在你的情况下无关紧要。 see using API和 Component-Naming-Conventions 只需使用标签:<md-drawer/>
更新
如何使用自定义 Drawer
在 md-app
.
drawer
必须包裹在 md-app-drawer
中
例子
代码:
<md-app-drawer :md-active.sync="menuVisible">
<custom-drawer/>
</md-app-drawer>
关于javascript - 布局组件(抽屉、工具栏等)不作为组件工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48636344/
我目前正在试用抽屉小部件。我构建了一个带有汉堡菜单图标、标题文本和搜索图标的应用栏。 这是我的代码: ` import 'package:flutter/material.dart'; import
我仍然是 Flutter 的初学者,我想创建一个带有侧边抽屉和底部导航标签栏的 Flutter 移动应用程序。我创建了带有侧边抽屉和底部导航的应用程序,但我的问题是我想从抽屉和底部导航选项卡打开主页。
试图检查位置固定元素的宽度。单击菜单图标容器后,抽屉的宽度应从 0% 增加到 18%。如果单击文档正文,抽屉应关闭,但前提是抽屉的宽度为 18%。当我尝试将抽屉的宽度记录到控制台时,我得到了 0px,
我在 Flutter 项目中有一个简单的抽屉,我想让抽屉在用户滑动/打开时始终位于底部导航栏上方。我玩弄我的代码,但还找不到任何解决方案。 import 'package:flutter/m
我在抽屉里装了一个粘头。但是现在我在 header 和第一个ListTile项之间有一个空格。 如何删除此空间/将项目设置在标题的末尾? 谢谢你的帮助! (我必须删除一些ListTiles,因为它对于
我想提供一种使 antd 抽屉可调整大小的方法? 我读了一篇热门answer专门针对 material-ui/Drawer 但我希望用 antd 做一些非常相似的事情。 有没有人有类似的 antd 示
我想提供一种使 antd 抽屉可调整大小的方法? 我读了一篇热门answer专门针对 material-ui/Drawer 但我希望用 antd 做一些非常相似的事情。 有没有人有类似的 antd 示
是否有用于绘制/可视化图形的良好 C# 库?我说的是节点路径可视化而不是折线图等。 (最好是原生的,而不是 pstricks 的包装器或类似的东西)谢谢 最佳答案 一些提示: QuickGraph是一
在我的页面中,我有两个具有相同项目的 Material Design Component 抽屉。一个对于桌面/平板电脑显示是永久性的,另一个对于移动显示是隐藏/模态的。 A
我的抽屉 View 没有显示它在我没有对布局或 MainActivity 进行任何更改之前工作正常,现在当我检查它时什么也没显示 我的 XML 抽屉菜单
我正在尝试使用 jQuery 实现类似抽屉的效果。我的页面由两个重叠的 div 组成,其中顶部的 div 已稍微向一侧移动,露出一些底部的 div。 当我将鼠标悬停在底部的 div 上时,我希望顶部的
根据 latest guidelines对于导航栏,它应该放在屏幕的底部,当带有工具栏的抽屉放在屏幕的顶部时。 考虑到这一点,横幅广告应该放在哪里?根据ad placement guidelines它
我的目标是拥有一个用于在不同路线之间导航的抽屉。如果我们当前在该路线上,我想通过更改抽屉中路线名称的颜色使其看起来更好一些。 我的问题是,每次按下汉堡包菜单时,都会显示一个新的抽屉实例,因为在每条 r
我正在尝试使用一些上边距来实现 Material UI 抽屉,而不是从页面的最顶部开始,但它没有发生,我尝试应用 marginTop 但它没有发生。这是codeSandBox链接Drawer . 如何
我将 vue 与 vue-material 一起使用. 我目前正在使用 md-app 布置我的 Web 应用程序的主要结构。作为 md-[app-]drawer 的根目录, md-[app-]tool
抽屉扩展 Activity 的抽屉 fragment 的第二个 Activity 我有一些问题..在导航 activity2 到 Activity1 的 fragment 时 我试过这段代码..
我构建了一个类似抽屉的“窗口”,它会在用户触摸按钮时出现。抽屉从屏幕底部开始动画并填满整个屏幕。 抽屉实际上是一个UITableViewController,因此抽屉里有一张 table 。 如果我有
这是场景:我有一个按钮 B,还有一个滑动抽屉,拉出时会覆盖整个屏幕。当我拉出屏幕并触摸 B 曾经可见的屏幕时,它的 Action 仍在执行。 我该如何解决这个问题? 我找到了 this线程描述了同样的
我正在使用 React Native 为 Android 开发应用程序。我使用 Wix 的 React Native Navigation 包处理导航,但我有疑问。 现在我的 mi 应用程序在我的手机
我想在 Android 应用程序中添加 Material 抽屉...所以我们需要包含一个工具栏...但是当我们包含工具栏时我得到了错误我的 activitymain_xml 代码是
我是一名优秀的程序员,十分优秀!