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.
captain-ui
Advanced tools
npm i -S captain-ui
// .babelrc or babel-loader option
{
"plugins": [
["import", { "libraryName": "captain-ui", "style": true }]
]
}
接着你可以直接引入 captain-ui 组件,等价于下方的按需引入组件
// 模块化地引入 js 和 css, 通过 babel-plugin-import 插件解析
import { Pay } from 'captain-ui';
每个组件都有自己对应的npm包,可以直接单独引入对应的包
import { Pay } from 'captain-pay';
css 文件引入需要 postcss-easy-import 类似插件解析引入的css文件路径
@import 'captain-pay';
// 没有插件的情况下,可以用以下方式直接引入
// @import 'captain-pay/lib/index.css';
yarn install
ynpm install -g felint #代码校验
felint hooks #添加校验钩子
localhost 127.0.0.1
make dev
在浏览器中打开 http://localhost:3003/ 即可
以创建组件 OrderPay 为例
在 docs/doc.config.js
中增加对应的文档配置
在 docs/examples-docs
目录下增加对应组件的文档,默认会直接引入 index.md
文档进行编译
与index.md同级目录下的 config.js
定义mock的请求数据,格式如下:
module.exports = [{
// 发起请求的链接
url: '/v2/pay/UnifiedCashier/getQrcode.json',
// 发起请求的请求方式
method: 'POST',
// 请求的返回数据内容
response: {
code: 0,
msg: '处理成功',
data: {
content: 'aHR0cHM6Ly93d3cuaGFvMTIzLmNvbS8=',
imageFormat: 'png',
codeFormat: 'QR_CODE',
encoding: 'BASE64',
width: 300,
height: 300
}
}
}, {
url: '/v2/pay/UnifiedCashier/payStatus.json',
method: 'POST',
response: {
code: 0,
msg: '处理成功',
data: {
status: 'success'
}
}
}];
npm run deploy
i qabb-fe-doc0
cd /data/project/captain-ui/
sudo git pull
FAQs
有赞vue wap业务组件库
The npm package captain-ui receives a total of 4 weekly downloads. As such, captain-ui popularity was classified as not popular.
We found that captain-ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 12 open source maintainers 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.