vue-cli-plugin-beansflight-tem

0.1.0 • Public • Published

vue-cli-plugin-beansflight

Description

A Vue CLI plugin to generate components or pages.

Support

Component

  • [x] SFC(.vue)
  • [x] TSX(.tsx)
  • [x] JSX(.jsx)

Style

  • [x] CSS(.css)
  • [x] SCSS(.scss)
  • [x] Sass(.sass)
  • [x] Less(.less)
  • [x] Stylus(.styl)

Usage

Install

vue add vue-cli-plugin-beansflight

or

yarn add vue-cli-plugin-beansflight -D
vue invoke generators

Run

Add a component

yarn create-component

Add a page

yarn create-page

Template

Component

JSX/TSX
/**
 * @file HelloWorld
 */
import { defineComponent, ref } from 'vue';

import './index.css';

export default defineComponent({
  name: 'HelloWorld',
  setup() {
    const str = ref('World');

    /**
     * @function ChangeStr
     * @description handle str change
     */
    const handleStrChange = () => {
      str.value = 'Vue';
    };

    return {
      str,
      handleStrChange
    };
  },
  render() {
    const { str, handleStrChange } = this;

    return (
      <div className="HelloWorld_container">
        <h1>Hello{str}!</h1>
        <button onClick={handleStrChange}>Change Hello</button>
      </div>
    );
  }
});
SFC
<template>
  <div class="HelloWorld_container">
    <h1>Hello{{ str }}</h1>
    <button @click="handleStrChange">Change Hello</button>
  </div>
</template>

<script>
/**
 * @file HelloWorld
 */
import { defineComponent, ref } from 'vue';

export default defineComponent({
  name: 'HelloWorld',
  setup() {
    const str = ref('World');

    /**
     * @function ChangeStr
     * @description handle str change
     */
    const handleStrChange = () => {
      str.value = 'Vue';
    };

    return {
      str,
      handleStrChange
    };
  }
});
</script>

<style>
</style>

Package Sidebar

Install

npm i vue-cli-plugin-beansflight-tem

Weekly Downloads

9

Version

0.1.0

License

MIT License

Unpacked Size

35.5 kB

Total Files

24

Last publish

Collaborators

  • miyaliunian