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.
vue-module-class-generator
Advanced tools
Module class helper generator for vue css modules
yarn
yarn add vue-module-class-generator
npm
npm i vue-module-class-generator
interface Mods {
[key: string]: boolean | string
}
c(mainClass?: string | Mods, mods?: Mods)
import Vue from 'vue'
import ClassGenerator from 'vue-module-class-generator'
Vue.use(classGenerator, {
methodName: 'c', // default
prefix: {
mod: '', // if 'is' === isActive else 'active'
modKey: '', // if is === colorIsRed else colorRed
},
})
import { classMixin } from 'vue-module-class-generator'
export default {
name: 'block',
mixins: [classMixin(config)]
}
<template>
<div :class="c($style.block, { active, color })">
</div> <!-- result :class="[$style.block, $style.active, $style.colorRed]" -->
</template>
<script>
import { classMixin } from 'vue-module-class-generator'
export default {
name: 'block',
props: {
active: Boolean,
color: String,
},
mixins: [classMixin()]
}
</script>
<style module>
.block {
display: block;
}
.active {
background-color: blue;
}
.colorRed {
color: red;
}
</style>
methodName: string
- set methodName in component
import { classMixin } from 'vue-module-class-generator'
export default {
mixins: [classMixin(), classMixin({ methodName: 'gen' })],
mounted() {
typeof this.c === 'function' // true
typeof this.gen === 'function' // true
}
}
prefix.mod: string
- set prefix to boolean mode
// prefix.mod = 'is'
c($style.element, { active: true }) // [$style.element, $style.isActive]
// prefix.mod = ''
c($style.element, { active: true }) // [$style.element, $style.active]
prefix.modKey: string
- set prefix to key mode
// prefix.modKey = 'is'
c($style.element, { color: 'red' }) // [$style.element, $style.colorIsRed]
// prefix.modKey = ''
c($style.element, { color: 'red' }) // [$style.element, $style.colorRed]
0.4.1 (2018-10-25)
<a name="0.4.0"></a>
FAQs
Vue class helper
The npm package vue-module-class-generator receives a total of 0 weekly downloads. As such, vue-module-class-generator popularity was classified as not popular.
We found that vue-module-class-generator 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.