问题
I'd like to use specific modules from semantic-ui
, https://semantic-ui.com/modules/sticky.html
Suppose I also use other frameworks mainly (such as bootstrap).
I wouldn't want to include the whole semantic-ui
just for the one module I need.
Is there a way to import (include..) only the specific modules I need from semantic-ui?
回答1:
Just simply include .css
file and .js
(if it's available) file of the specific component. Here is an example with a CDN:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.11/components/sticky.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.11/components/sticky.js" ></script>
You can find all the components in dist/components/
folder, for more information about semantic-ui installation see Semantic-UI on GitHub
来源:https://stackoverflow.com/questions/45297987/way-to-import-small-parts-of-semantic-ui