Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jxstjh/kun-cli

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jxstjh/kun-cli

Vue js component generator

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

@kun/cli 自动生成Vue组件

自动生成vue文件【bete】

全局安装

npm install -g @jxstjh/kun-cli

使用说明

kun --help

创建单文件组件

kun home

将生成一个单文件Vue组件:

<template lang="html">
  <section class="home">
    <h1>home Component</h1>
  </section>
</template>

<script lang="js">
  export default  {
    name: 'Home',
    props: [],
    mounted() {

    },
    data() {
      return {

      }
    },
    methods: {

    },
    computed: {

    }
}
</script>

<style scoped lang="less">

</style>

新建单文件组件并且新建文件夹

kun home --folder

创建指令

kun -d my-directive

将自动生成:

my-directive.directive.js

import Vue from 'vue'

Vue.directive('my-directive', {
  bind () {
    
  },
  inserted (el) {
    // el.focus();
  },
  update () {

  },
  unbind () {

  }
});

可以使用 -- postfix 来增加文件前缀

kun footer --postfix page

带前缀生成:

  • footer.page.js
  • footer.page.css
  • footer.page.html

生成普通js文件组件

kun -c view-top

会生成文件:

view-top.js

export default {
  name: 'ViewTop',
  props: [],
  mounted() {},
  data() {
    return {};
  },
  methods: {},
  computed: {}
};

view-top.html

<section class="view-top">
  <h1>view-top Component</h1>
</section>

view-top.less

.view-top {
}

index.vue

<template src="./view-top.component.html"></template>
<script src="./view-top.component.js"></script>
<style src="./view-top.component.less" scoped lang="less"></style>

切换自动生成文件的类型

sudo kun --html jade --style less --script ts --spec ts

Keywords

FAQs

Package last updated on 20 Jun 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc