Code Monkey home page Code Monkey logo

vue-my-template's Introduction

vue-my-template

Features Vue Settings

Using vue-cli3(@vue/cli)

  • TypeScript
  • Router
  • Vuex
  • CSS Pre-Processors
    • Stylus
  • Linter / Formatter
    • ESLint
    • Prettier
  • Unit Test
    • Jade

Features

  • class-style component syntax

  • Using Pug as a template engine

    • Rewriting vue's initial template using pug and stylus
  • Using vuex-module-decorators

  • Auto Lint on save

  • Atomic Design to separate the components, but it's not that exact

Coding Style

Style Guide

TypeScript Settings

	"strict": true,
	"noUnusedLocals": true,
	"noUnusedParameters": true,
	"noImplicitReturns": true,
	"noFallthroughCasesInSwitch": true,

Others

  • 2 spaces per indentation

Snippets

User Snippets for Visual Studio Code

.vue

	"vue-template": {
			"prefix": "vue-template",
			"body": [
				"<template lang=\"pug\">",
				"  .${1:name}",
				"</template>",
				"<script lang=\"ts\">",
				"import { Component, Vue } from \"vue-property-decorator\";",
				"import router from \"@/router\";",
				"",
				"@Component({",
				"  name: \"${1:name}\",",
				"  components: {}",
				"})",
				"export default class ${2:class} extends Vue {}",
				"</script>",
				"<style lang=\"stylus\" scoped>",
				".${1:name}",
				"</style>",
			],
			"description": "simple vue template"
	}

module

	"vue-template-module": {
		"prefix": "template-module",
		"body": [
			"import {",
			"  Mutation,",
			"  MutationAction,",
			"  Action,",
			"  VuexModule,",
			"  getModule,",
			"  Module",
			"} from \"vuex-module-decorators\";",
			"import store from \"@/store/store\";",
			"",
			"@Module({ dynamic: true, store, name: \"${1:counter}\", namespaced: true })",
			"class ${2:Counter} extends VuexModule {",
			"  // #region STATE",
			"  counter: number = 0;",
			"",
			"  // #endregion",
			"",
			"  // #region MUTATION",
			"  @Mutation // counter",
			"  public SET_COUNTER(num: number) {",
			"    this.counter = num;",
			"  }",
			"",
			"  // #endregion",
			"",
			"  // #region ACTION",
			"  @Action({ rawError: true })",
			"  public decrement() {",
			"    this.SET_COUNTER(this.counter + 1);",
			"  }",
			"",
			"  // #endregion",
			"",
			"  // #region MUTATION ACTION",
			"  @MutationAction({ mutate: [\"counter\"] })",
			"  async resetCounter() {",
			"    return {",
			"      counter: 0",
			"    };",
			"  }",
			"  // #endregion",
			"}",
			"export const ${1:counter} = getModule(${2:Counter});",
		],
		"description": "simple vue-module template"
	}

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Generate report.html to help analyze bundle content

npm run report

Run your tests

npm run test

Lints and fixes files

npm run lint

Run your unit tests

npm run test:unit

Customize configuration

See Configuration Reference.

vue-my-template's People

Contributors

nyaagoo avatar

Forkers

909173

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.