Skip to content

openfext/vue-use

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c807c5d Â· Jun 7, 2020

History

29 Commits
May 31, 2020
May 24, 2020
May 17, 2020
May 17, 2020
May 17, 2020
May 17, 2020
May 17, 2020
May 17, 2020
May 31, 2020
May 17, 2020
May 24, 2020
May 17, 2020
May 17, 2020
May 17, 2020
May 17, 2020
May 17, 2020
Jun 7, 2020
May 17, 2020
May 17, 2020
May 17, 2020
May 17, 2020
May 24, 2020
May 17, 2020

Repository files navigation

Vue Use

Use Vue Composition API Right Now.

Note: Currently only Vue.js 2.x is supported. Since Vue.js has released a beta version of 3.0, this library will support the latest version of Vue.js for the first time.

CircleCI codecov GitHub Version PRs Welcome

Docs

🇨🇳 Chinese

🇺🇸 English

WIP...

Features

  • ✨ useResize -- track window.innerWidth, window.innerHeight.
  • ✨ useLoading -- run asynchronous tasks and set loading status.
  • ✨ useForm -- manage model, events of complex form.
  • ✨ useFormElement -- create custom form components that support v-model, work with useForm.
  • ✨ useTable -- manage data, paging, sorting and filter of complex table.
  • ...

More features are coming soon...

Quick Start

Installation

npm i @fext/vue-use

Usage

Create reactive loading state for component:

<template>
  <div :class="{ 'is-loading': loading }">Content</div>
</template>

<script>
  import { useLoading } from '@fext/vue-use';

  export default {
    setup() {
      const { loading, withLoading } = useLoading();

      return {
        loading,
        withLoading
      };
    },

    created() {
      this.withLoading(() => {
        return this.fetchList();
      });
    },

    methods: {
      async fetchList() {
        // remote api
      }
    }
  };
</script>

Built With

License

MIT

Copyright (c) 2020 - present, Felix Yang