Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add support for vue v3 #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

unstabler
Copy link

@unstabler unstabler commented Nov 20, 2020

CHANGES

  1. migrate filters to App.config.globalProperties.$filters
  2. provide moment, moment-filters via Vue.provide<T>
  3. babelrc: add 'transform-object-rest-spread' plugin'

SYNOPSIS

<template>
    <div class="user" v-for="user in users" :key="user.id">
        <h3>{{ user.name }}</h3>
        <h5>last access: {{ $filters.moment(user.lastAccess, "YYYY-MM-DD") || "unknown" }}</h5>
    </div>
</template>
<script lang="ts">
import { defineComponent, watch, inject } from 'vue';
// ...

export default defineComponent({
  // ...
});

</script>
<template>
    <div class="user" v-for="user in users" :key="user.id">
        <h3>{{ user.name }}</h3>
        <h5>last access: {{ momentFilter.moment(user.lastAccess, "YYYY-MM-DD") || "unknown" }}</h5>
    </div>
</template>
<script lang="ts">
import { defineComponent, watch, inject } from 'vue';
// ...

export default defineComponent({
  setup() {
    const momentFilters = inject('moment-filters');
    // ...
    return {
      momentFilters,
      users
    };
  }
});

</script>
  1. sorry for my bad english

1. migrate filters to App.config.globalProperties.$filters
2. provide moment, moment-filters via Vue.provide<T>
@unstabler unstabler changed the title feature: support for vue v3 feature: add support for vue v3 Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant