Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
vue-component-tree
Advanced tools
Tree view for your demo components. Demo.
npm install -D vue-component-tree
yarn add -D vue-component-tree
I'll talk a bit about demo based workflow I employ in my projects.
Before doing any work on component I create a demo. Demo allows me to define an interface, like this:
<vm-new-component v-model="dataItem" :some-prop="prop"/>
Only then I start to work on component.
You can think of demo as of semi-manual unit tests. But why not use actual unit tests, you'll ask. Let me explain.
Of course, this doesn't mean you have to dump unit tests. Leave them for appropriate tasks. Like logic heavy classes.
So, back to the library. The main intent behind is simplifying demo workflow as much as possible. Just toss your demos into folder and enjoy tree generation.
Attach VueComponentTree to your router. And yes, vue-router is required.
import Router from 'vue-router'
import VueComponentTree from 'vue-component-tree'
const router = new Router({
routes: [
VueComponentTree.create(require.context('./../tree', true, /.vue$/), '/demo'),
]
})
So, about arguments.
require.context('./../tree', true, /.vue$/), '/demo'
./../tree
is path to your demo folder. Works the same as require/import./demo
is root route for vue-router.Inside of your demo component you can set set some options. All of them are optional.
{
$componentTree: {
status: 'wip',
component: VmMainComponent, // This allows us to figure out component relations.
description: 'Your description',
},
data () {
// ...
}
}
Will colorize filenames on the tree in accordance.
Supported statuses are:
You can add your own status. They're just css classes.
Component means main component for demo. If you omit this option - the library will try to guess, which of registered components is main.
For example, if you have ParentDemo.vue
demo-component, and you have registered inside {name: 'VmParent'} - the library will guess correctly.
component
options is required for dependency tracking to work.
You don't have to keep demos in production. Use webpack define-plugin and exclude them from bundle.
Leave an issue if something doesn't work for you.
Also remember: Stars fuel package development!
MIT
FAQs
Tree view for your demo components
The npm package vue-component-tree receives a total of 7 weekly downloads. As such, vue-component-tree popularity was classified as not popular.
We found that vue-component-tree 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.
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.