@deppon/deppon-norm
Frontend norm utilities package
17,076
| Install | |
|---|---|
npm install @deppon/deppon-norm |
|
| Latest Version: | 2.5.105 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Sep 11, 2026 |
| Links: | npm |
Maintainer: wangyang1103
@deppon/deppon-norm
前端规范工具包
安装
npm install @deppon/deppon-norm
基础使用
JavaScript/TypeScript 项目
import { commit, note, start, stylelint } from '@deppon/deppon-norm';
// 使用 commit
commit('commit message');
// 使用 note
note('note message');
// 使用 start
start('start message');
// 使用 stylelint
stylelint('stylelint message');
Vue 3 使用
1. 安装插件
在 Vue 应用中安装插件:
import { createApp } from 'vue';
import { VuePlugin } from '@deppon/deppon-norm';
const app = createApp(App);
// 安装插件
app.use(VuePlugin);
app.mount('#app');
2. 在 Composition API 中使用
<script setup>
import { useNorm } from '@deppon/deppon-norm';
const norm = useNorm();
const handleCommit = () => {
norm.commit('commit message');
};
const handleNote = () => {
norm.note('note message');
};
const handleStart = () => {
norm.start('start message');
};
const handleStylelint = () => {
norm.stylelint('stylelint message');
};
</script>
<template>
<button @click="handleCommit">Commit</button>
<button @click="handleNote">Note</button>
<button @click="handleStart">Start</button>
<button @click="handleStylelint">Stylelint</button>
</template>
3. 在 Options API 中使用
<script>
export default {
methods: {
handleCommit() {
// 通过 this.$norm 访问
this.$norm.commit('commit message');
},
handleNote() {
this.$norm.note('note message');
},
handleStart() {
this.$norm.start('start message');
},
handleStylelint() {
this.$norm.stylelint('stylelint message');
},
},
};
</script>
API
Composition API
useNorm()- 获取 norm 实例
方法
commit(param1)- Commit 方法note(param1)- Note 方法start(param1)- Start 方法stylelint(param1)- Stylelint 方法
更多 API 请参考源码。
Related Packages
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 2.5.105 | ^3.0.0 | MIT | |
| 2.5.102 | ^3.0.0 | MIT | |
| 2.5.101 | ^3.0.0 | MIT | |
| 2.5.100 | ^3.0.0 | MIT | |
| 2.5.98 | ^3.0.0 | MIT | |
| 2.5.97 | ^3.0.0 | MIT | |
| 2.5.95 | ^3.0.0 | MIT | |
| 2.5.94 | ^3.0.0 | MIT | |
| 2.5.83 | ^3.0.0 | MIT | |
| 2.5.82 | ^3.0.0 | MIT | |
| 2.5.79 | ^3.0.0 | MIT | |
| 2.5.77 | ^3.0.0 | MIT | |
| 2.5.76 | ^3.0.0 | MIT | |
| 2.5.75 | ^3.0.0 | MIT | |
| 2.5.74 | ^3.0.0 | MIT | |
| 2.5.73 | ^3.0.0 | MIT | |
| 2.5.72 | ^3.0.0 | MIT | |
| 2.5.71 | ^3.0.0 | MIT | |
| 2.5.60 | ^3.0.0 | MIT | |
| 2.5.58 | ^3.0.0 | MIT | |
| 2.5.56 | ^3.0.0 | MIT | |
| 2.5.54 | ^3.0.0 | MIT | |
| 2.5.53 | ^3.0.0 | MIT | |
| 2.5.51 | ^3.0.0 | MIT | |
| 2.5.49 | ^3.0.0 | MIT | |
| 2.5.48 | ^3.0.0 | MIT | |
| 2.5.46 | ^3.0.0 | MIT | |
| 2.5.42 | ^3.0.0 | MIT | |
| 2.5.41 | ^3.0.0 | MIT | |
| 2.5.40 | ^3.0.0 | MIT |
Showing the latest 30 of 102. See every release on npm