Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
A Set of React Components that Implement Google's Material Design
bower install melon
melon-core
melon
http://react-melon.github.io/melon
You need use es5-shim
和 es5-sham
on ie8
see es5-shim
es5-sham
es5-shim
安装依赖
# melon
npm i melon --save
# 编译 melon 样式的依赖
npm i stylus-loader file-loader stylus nib css-loader style-loader --save-dev
配置 webpack
:
在 webpack
中添加以下配置
module.exports = {
loaders: [
// 处理 stylus
{
test: /\.styl$/,
loader: 'style!css!stylus?paths=node_modules&resolve url'
},
// 处理 iconfont
{
test: /\.(svg|eot|ttf|woff)(\?.*)?$/,
loader: 'file'
}
],
// stylus loader 中引入 nib 库支持
stylus: {
use: [require('nib')()]
}
};
其中,stylus
的参数中的 paths=node_modules
指定 stylus 文件的寻找范围,resolve url
用于将 melon 中相对路径资源转换为绝对路径资源。
使用一个 stylus
文件来引入业务所需要的 melon 样式文件。
将 melon 组件的样式组织在一个入口样式文件中,比如 ${YOUR_PROJECT}/src/melon.styl
。
// 主题必须引入
@require 'melon/css/theme/default/index.styl';
// 其他组件按需引入
@require 'melon/css/Button.styl';
其中主题样式文件是必选的,然后需要用到什么组件,就引入相应的组件样式。
在合适的 js 中引入需要的 melon 组件:
// 加载样式
import './melon.styl';
// 加载组件
import Button from 'melon/Button';
export default function App(props) {
return (
<Button>melon button</Button>
);
}
经过以上步骤就完成了 melon 的引入了。另外,还可以参考这个 demo repo。
FAQs
ui components for react
The npm package melon receives a total of 6 weekly downloads. As such, melon popularity was classified as not popular.
We found that melon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.