🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

cspt-test

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cspt-test

传晟公共组件库

latest
npmnpm
Version
0.0.42
Version published
Weekly downloads
10
-37.5%
Maintainers
1
Weekly downloads
 
Created
Source

研发中心公共组件库

环境要求

nodejs =>18

使用说明

1、安装本地依赖

npm install

2、正式打包

npm run build

3、进行发布

npm publish

4、其它项目中使用

npm install cspt-component

5、其它项目中卸载库

npm uninstall cspt-component

6、其它项目中更新库

npm update cspt-component

或者

npm install cspt-component@latest

调试打包后的组件

1、如果想调试组件的话,可以使用以下命令:

npm run build -- --watch

以上的命令会在打包构建时启用监听模式,这样你在修改组件代码后,会自动重新构建。

2、然后你想在其他的项目当中查看你修改的组件功能,可以通过以下命令创建一个软连接:

npm link

以上的命令就是在全局的 node_modules 目录下创建一个软连接,指向你当前项目的 dist 目录

3、然后你可以在其他项目当中使用以下命令来关联你修改的库,在开发模式下,只要你修改了组件代码,那么就可以实时的查看修改的功能

npm link cspt-component

该命令在可以关联你打包的这个库,如果你项目中已经安装了 cspt-component 这个库的话,也会优先调用 npm link 关联的包,而不是本地已经下载的包, 注意,需要先启动其他项目之后,再执行上面的命令进行 npm link cspt-component 的关联

4、如果想取消关联的话,可以在其他项目中使用以下命令:

npm unlink cspt-component

以上的命令就是在全局的 node_modules 目录下删除你创建的软连接,就取消了关联了

注意事项

1、作为平台的公共组件库,在新增其他公共组件时,请保持组件的命名规范,组件的命名规范为:Cs 组件名 大驼峰的形式,组件的入口文件统一为 index.vue

2、如果公共组件中涉及到对应的注册文件,或者 hooks,或者指令文件,请在 src 目录下面对应的 component.js、directive.js、install.js 里面进行导入

3、组件和其他公共方法请提供 export,export default 的形式

4、每一次打包发布,请在 package.json 文件中修改版本号,版本号的修改规则为:主版本号.次版本号.修订号,例如:1.0.0

5、打包、发布更新请提交 SVN 代码之后,联系我进行操作

官网地址:https://www.npmjs.com/package/cspt-component

Keywords

components

FAQs

Package last updated on 16 Sep 2025

Did you know?

Socket

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.

Install

Related posts