简体   繁体   English

如何在不使用semantic.css 的情况下在Semantic UI 中实现组件?

[英]How Can I implement the components in Semantic UI without using semantic.css?

I want to create a multi-selection dropdown using the Semantic UI dropdown module.我想使用语义 UI 下拉模块创建一个多选下拉列表。

From the Semantic documentation, it says that I need to add the following code.从语义文档中,它说我需要添加以下代码。

<link rel="stylesheet" type="text/css" href="semantic/dist/semantic.min.css">
<script
  src="https://code.jquery.com/jquery-3.1.1.min.js"
  integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
  crossorigin="anonymous"></script>
<script src="semantic/dist/semantic.min.js"></script>

As I am also using bootstrap in my project, I am facing the problem that the semantic.min.css is messing up the bootstrap layout.由于我也在我的项目中使用引导程序,我面临着语义.min.css 弄乱引导程序布局的问题。 To avoid this, I tried using just the dropdown component.为了避免这种情况,我尝试只使用下拉组件。

<link rel="stylesheet" type="text/css" href="semantic/dist/components/dropdown.min.css">
<script
  src="https://code.jquery.com/jquery-3.1.1.min.js"
  integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
  crossorigin="anonymous"></script>
<script src="semantic/dist/semantic.min.js"></script>

This did fix the layout issue, but now there is no dropdown when I click on the dropdown box.这确实解决了布局问题,但是现在当我单击下拉框时没有下拉列表。

Any suggestions for what I can do?对我能做什么有什么建议吗?

You must to start the dropdown你必须开始下拉

$('.ui.dropdown')
  .dropdown()
;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM