具有离子功能的MaterialiseCSS下拉列表

时间:2022-05-18 19:07:26

I'm developing an Ionic mobile app with Materialize CSS. The problem is when I have to add components like dropdown menu.

我正在使用Materialise CSS开发一个Ionic移动应用程序。问题是当我必须添加下拉菜单等组件时。

 <!-- Dropdown Trigger -->
  <a class='dropdown-button btn' href='#' data-activates='dropdown1'>Drop Me!</a>

  <!-- Dropdown Structure -->
  <ul id='dropdown1' class='dropdown-content'>
    <li><a href="#!">one</a></li>
    <li><a href="#!">two</a></li>
    <li class="divider"></li>
    <li><a href="#!">three</a></li>
  </ul>

The problem is href in dropdown-button, which redirect to a Route which address # instead of showing the menu.

问题是下拉按钮中的href,它会重定向到一个地址#,而不是显示菜单。

How can I make working this component?

我该如何使用这个组件?

Thanks

1 个解决方案

#1


I know it is late to answer this question, but wanted to share somethings...

我知道回答这个问题已经很晚了,但想分享一些事情......

I think the dropdown problem is with the jQuery, because it is not supported by cordova or phonegap hybrid application, where you have used the ionic.

我认为下拉问题与jQuery有关,因为你使用离子的cordova或phonegap混合应用程序不支持它。

You can use pure javascript or angularjs in hybrid applications. you can also use ionic's dropdown and add a custom class using materializecss's dropdown design by copying the dropdown class from materialize.css file.

您可以在混合应用程序中使用纯javascript或angularjs。您还可以使用ionic的下拉列表,并使用materializecss的下拉设计通过复制materialize.css文件中的下拉类来添加自定义类。

Best way to use materializecss in ionic frame work is to use the CSS code only, and use other javascript plugins to get that effects.

在离子帧工作中使用materializecss的最佳方法是仅使用CSS代码,并使用其他javascript插件来获得该效果。

You can also use ionic material if you like some of it's features similar to materializecss

如果你喜欢它的一些类似于materializecss的功能,你也可以使用离子材料

#1


I know it is late to answer this question, but wanted to share somethings...

我知道回答这个问题已经很晚了,但想分享一些事情......

I think the dropdown problem is with the jQuery, because it is not supported by cordova or phonegap hybrid application, where you have used the ionic.

我认为下拉问题与jQuery有关,因为你使用离子的cordova或phonegap混合应用程序不支持它。

You can use pure javascript or angularjs in hybrid applications. you can also use ionic's dropdown and add a custom class using materializecss's dropdown design by copying the dropdown class from materialize.css file.

您可以在混合应用程序中使用纯javascript或angularjs。您还可以使用ionic的下拉列表,并使用materializecss的下拉设计通过复制materialize.css文件中的下拉类来添加自定义类。

Best way to use materializecss in ionic frame work is to use the CSS code only, and use other javascript plugins to get that effects.

在离子帧工作中使用materializecss的最佳方法是仅使用CSS代码,并使用其他javascript插件来获得该效果。

You can also use ionic material if you like some of it's features similar to materializecss

如果你喜欢它的一些类似于materializecss的功能,你也可以使用离子材料