All Projects → joon610 → vue-corator

joon610 / vue-corator

Licence: MIT license
this is vue decorator utils

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to vue-corator

ngx-redux-core
The modern redux integration for Angular 6+
Stars: ✭ 32 (-3.03%)
Mutual labels:  decorators, decorator
leeks.js
Simple ANSI styling for your terminal
Stars: ✭ 12 (-63.64%)
Mutual labels:  style
ts-test-decorators
Write your tests in a Java-like annotation-driven manner via JS decorators
Stars: ✭ 37 (+12.12%)
Mutual labels:  decorators
CustomWebCheckbox
An example of a make checkbox design on the web.
Stars: ✭ 12 (-63.64%)
Mutual labels:  style
realar
5 kB Advanced state manager for React
Stars: ✭ 41 (+24.24%)
Mutual labels:  decorators
type-arango
🥑 TypeArango manages ArangoDB collections, documents, relations and routes by taking advantage of TypeScript typings.
Stars: ✭ 55 (+66.67%)
Mutual labels:  decorators
tsed
📐 Ts.ED is a Node.js and TypeScript framework on top of Express to write your application with TypeScript (or ES6). It provides a lot of decorators and guideline to make your code more readable and less error-prone.
Stars: ✭ 2,350 (+7021.21%)
Mutual labels:  decorators
standard-www
👆 Website for JavaScript Standard Style (@standard)
Stars: ✭ 28 (-15.15%)
Mutual labels:  style
discord-nestjs
👾 NestJS package for discord.js
Stars: ✭ 173 (+424.24%)
Mutual labels:  decorator
is-style-supported
Feature test support for CSS properties and their assignable values
Stars: ✭ 17 (-48.48%)
Mutual labels:  style
mocha-allure2-example
Allure 2 Mocha examples
Stars: ✭ 18 (-45.45%)
Mutual labels:  decorators
TvrboReact
Dream starter project: React, Redux, React Router, Webpack
Stars: ✭ 13 (-60.61%)
Mutual labels:  decorators
Python
covers python basic to advance topics, practice questions, logical problems in python, web development using html, css, bootstrap, jquery, DOM, Django 🚀🚀. 💥 🌈
Stars: ✭ 29 (-12.12%)
Mutual labels:  decorators
typijs
The Angular CMS Framework for building fully-featured SPA sites powered by NodeJS and MongoDB with TypeScript
Stars: ✭ 141 (+327.27%)
Mutual labels:  decorators
futils
Utilities for generic functional programming
Stars: ✭ 21 (-36.36%)
Mutual labels:  decorators
serialize
Serializers for typescript based on decorators
Stars: ✭ 14 (-57.58%)
Mutual labels:  decorators
jss-material-ui
A enhanced styling engine for material-ui
Stars: ✭ 15 (-54.55%)
Mutual labels:  style
deqaf
Decaffeinate CSS stylesheets client-side
Stars: ✭ 30 (-9.09%)
Mutual labels:  style
log-utils
Basic logging utils: colors, symbols and timestamp.
Stars: ✭ 24 (-27.27%)
Mutual labels:  style
react-native-styled-text
Styled Text for React Native
Stars: ✭ 57 (+72.73%)
Mutual labels:  style

Vue Corator

Update

  • @Render: add functional atturibute in component 2019/08/23
  • @Style: Style tag changed global to scoped 2019/08/22
  • @Hoc : high order component
  • @DeepCopy : DeepCopy decorator

License

MIT License

Install

npm i -S vue-corator

Vue.config.js

//if you use Vue CLI3.0
//vue.config.js
module.exports ={
    runtimeCompiler:true
}

or

webpack.config.js

//webpack
module.exports = {
  // ...
  resolve: {
    alias: {
      'vue$': 'vue/dist/vue.esm.js' // 'vue/dist/vue.common.js' for webpack 1
    }
  }
}

Usage

See also

@Render(componentName?:string) decorator

<template>
  <good :items="data" title="Vue corator"></good>
</template>
import {Render} from 'vue-corator'
@Component
export default class YourComponent extends Vue {

    private data = ['hello', 'Functional Component'];

    @Render()
    private good(items: any, title: any) {
      return  `
            <div>
             <b> {{ title }} </b>
              <ul>
                <li v-for="(item,index) in items" :key="index">
                      {{ item }}
                </li>
              </ul>
            </div>`;
    }
}

See also: Runtime + Compiler vs. Runtime only.

@Style() decorator

<template>
  <div>
    <styleTagName1>
      .title { background:red }    // .title [data-v-<hash>] {background:red}
    </styleTagName1>   
  </div>
</template>
import {Style} from 'vue-corator'
@Component
export default class YourComponent extends Vue {

  @Style()
  private styleTagName1() {
    return `
        .title { background:pink }
    `;
  }
}

@NextTick() decorator

import { NextTick } from 'vue-corator'
@Component
export default class YourComponent extends Vue {
  @NextTick()
  private methodName(){
    this.method1();
  }
}

Is equivalent

@Component
export default class YourComponent extends Vue {
  private mounted() {
    this.$nexttick(()=>{
      this.method1();
    })
  }
}

@ScopedId(Key?: string) decorator

import { Component, Prop, Vue } from 'vue-property-decorator';
import { ScopedId } from 'vue-corator';
@Component
export default class YourComponent extends Vue {
  @ScopedId() scopedId!: string      //returns component Id like 'data-v-xxxxx'
}

returns component Id like 'data-v-xxxxx'

@Super(component: any) decorator

import { Component, Prop, Vue } from 'vue-property-decorator';
@Component
export default class Parent extends Vue {

  private father(){
      console.log('father')
  }
}
import { Component, Prop, Vue } from 'vue-property-decorator';
import { Super } from 'vue-corator';
import Parent from './parent.vue'
@Component
export default class Child extends Parent {
  @Super(Parent) super!: any  

  private father(){
      console.log('childs father')
  }

  private mounted(){
    console.log(this.father());
    console.log(this.super.father());
  }
}
  $ childs father
  $ father
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].