2.3.9 โ€ข Published 2 months ago

vue-act-master v2.3.9

Weekly downloads
39
License
MIT
Repository
github
Last release
2 months ago

Vue-Act-Master

A way to separate business logic from application view.

The easiest library to create a flexible application architecture.

npm bundle size npm version


๐Ÿ“— Documentation

๐Ÿงช Test writing with "ActTest"


Example

Installation

npm install vue-act-master

Usage

// main.ts
// install vue-act-master plugin
import Vue from 'vue';
import App from './App.vue';

import { VueActMaster } from 'vue-act-master';

// Actions array
import { actions } from '../act/actions';

Vue.use(VueActMaster, {
  actions,
});

new Vue({
  el: '#app',
  render: (h) => h(App),
});
// ../act/actions
export const actions: ActMasterAction[] = [
  new GetDataAction(),
];
// action-get-data.ts
import { ActMasterAction } from 'vue-act-master';

export class GetDataAction implements ActMasterAction {
  name = 'GetData';

  async exec() {
    const url = 'https://jsonplaceholder.typicode.com/todos/1';

    const response = await fetch(url);
    return response.json();
  }
}

The action is now available to you in components and you can easily highlight the business logic.

This will help you test components and change the API more easily.

// App.vue

<script>
export default {
  data() {
    return {
      myData: null,
    };
  },

  async mounted() {
    console.log(this.myData); // null

    this.myData = await this.$act.exec('GetData');

    console.log(this.myData);
    // {
    //   "userId": 1,
    //   "id": 1,
    //   "title": "delectus aut autem",
    //   "completed": false
    // }
  }
}
</script>
2.3.9

2 months ago

2.2.1

6 months ago

2.2.0

6 months ago

2.3.8

5 months ago

2.3.6

6 months ago

2.0.3

10 months ago

2.0.2

10 months ago

2.0.4

9 months ago

2.0.1

10 months ago

2.1.2

9 months ago

2.1.1

9 months ago

2.1.0

9 months ago

2.0.0

12 months ago

0.16.0

2 years ago

0.15.3

2 years ago

0.15.2

2 years ago

0.15.0

2 years ago

0.15.1

2 years ago

0.13.0

3 years ago

0.13.1

3 years ago

0.13.2

3 years ago

0.12.0

3 years ago

0.14.0

3 years ago

0.14.1

3 years ago

0.11.1

3 years ago

0.11.2

3 years ago

0.11.0

3 years ago

0.10.0

3 years ago

0.9.10

3 years ago

0.9.8

3 years ago

0.9.9

3 years ago

0.9.7

3 years ago

0.9.6

3 years ago

0.9.4

3 years ago

0.9.3

3 years ago

0.9.5

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.8.8

3 years ago

0.8.7

3 years ago

0.9.0

3 years ago

0.8.6

3 years ago

0.8.5

3 years ago

0.8.4

3 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.4

3 years ago

0.6.3

3 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago