MyGit

v3.2.0

vuetifyjs/vuetify

版本发布时间: 2023-04-27 22:23:12

vuetifyjs/vuetify最新发布版本:v3.7.4(2024-11-06 15:40:15)

v3.2.0 (Orion)

Welcome to the v3.2 release of Vuetify! The team has been hard at work on some exciting new updates and we're excited to finally get it into your hands!

Orion has a huge focus on improving the defaults engine and giving users more tools to customize their application. We started by adding support for global class and style defaults; then hooked it up to virtual components.

For example, you can set the default class for all v-btn components to be my-btn:

import { createVuetify } from 'vuetify'

export default createVuetify({
  defaults: {
    VBtn: {
      class: 'my-btn',
    },
  },
})

The same is possible for virtual components as well. Simply alias a core component and reference it by its name in the config object:

import { createVuetify } from 'vuetify'
import { VBtn } from 'vuetify/components/VBtn'

export default createVuetify({
  aliases: {
    MyBtn: VBtn,
  },

  defaults: {
    MyBtn: {
      color: 'primary',
      class: 'my-btn',
      variant: 'tonal',
    },
  },
})

Whenever you use the MyBtn component in any template it will be rendered as a v-btn with the default props applied:

<template>
  <my-btn>My Button</my-btn>
  <!-- <v-btn color="primary" variant="tonal" class="mt-btn">...</v-btn>-->
</template>

Finally, we made our defaults composable publicly available. Now you can hook your custom components into the defaults engine and configure your entire application from a single source.

<template>
  <div>
    I am {{ props.foo }}
  </div>
</template>

<script setup>
  import { useDefaults } from 'vuetify'

  const _props = defineProps({ foo: String })
  const props = useDefaults(_props)
</script>

defaults

The defaults composable also works with nested configurations. This works in any combination of virtual, custom, and core Vuetify components.

For example, you can create a custom component that modifies the default behavior of its children:

import { createVuetify } from 'vuetify'
import { VBtn } from 'vuetify/components/VBtn'
import { VCard } from 'vuetify/components/VCard'

export default createVuetify({
  aliases: {
    MyBtn: VBtn,
    MyCard: VCard,
  },

  defaults: {
    MyBtn: {
      color: 'primary',
      class: 'my-btn',
      variant: 'tonal',
    },
    MyCard: {
      border: true,
      variant: 'text',

      MyBtn: {
        color: 'secondary',
        variant: 'text',
      },
    },
  },
})

Some other big feature updates in this release include:

With v3.2 complete, the team is preparing for v2.7-lts (Nirvana) and the next v3 release, Icarus. We've recently updated our roadmap to be more transparent about our plans for the future; as well as improve the information about each release. Also, we've drastically improved the performance of the documentation and added new tools, such as 🎮Vuetify Play, to all component examples.

image

We hope that you enjoy this release as much as we have enjoyed working on it.

Until next time,

John Leider


💪 Support Vuetify Development

Vuetify is an open source MIT project that has been made possible due to the generous contributions by our sponsors and backers. If you are interested in supporting this project, please consider:

📖 Table of Contents

📑 Upgrade guide

💯 Release notes

:rocket: Features

:wrench: Bug Fixes

:test_tube: Labs

BREAKING CHANGES

🆘 I need help!

If you are stuck and need help, don't fret! We have a very large and dedicated community that is able to provide help 24/7. Come to the #vuetify-3-help channel.

相关地址:原始地址 下载(tar) 下载(zip)

查看:2023-04-27发行的版本