Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.