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

feat: update grid system to Vue 3 #12822

Merged
merged 4 commits into from
Jan 11, 2021
Merged

feat: update grid system to Vue 3 #12822

merged 4 commits into from
Jan 11, 2021

Conversation

KaelWD
Copy link
Member

@KaelWD KaelWD commented Dec 22, 2020

No major changes - just composition API, prefixed classes, and removed the old grid system.

BREAKING CHANGE: grid classes now have a v- prefix
BREAKING CHANGE: v-layout, v-flex, and <v-container grid-list-{size}> have been removed

Markup:

<template>
  <v-app>
    <v-container class="grey lighten-5">
      <div class="display-1">New grid</div>
      <p>Margins y around red elements are larger</p>
      <v-row dense>
        <v-col
          :cols="12"
          class="green"
        >col 1</v-col>
        <v-col :cols="12">
          <v-row dense>
            <v-col class="red">col 2</v-col>
            <v-col class="red">col 3</v-col>
            <v-col class="red">col 4</v-col>
          </v-row>
        </v-col>
        <v-col class="green">col 5</v-col>
        <v-col class="green">col 6</v-col>
        <v-col
          cols="12"
          class="green"
        >col 7</v-col>
      </v-row>
    </v-container>

    <v-container class="grey lighten-5">
      <div class="display-1">New grid with gutters</div>
      <p>Margins y around red elements are larger</p>
      <v-row dense>
        <v-col :cols="12">
          <v-card
            class="pa-2 green"
            outlined
          >
            col 1
          </v-card>
        </v-col>
        <v-col :cols="12">
          <v-row dense>
            <v-col>
              <v-card
                class="pa-2 red"
                outlined
              >
                col 2
              </v-card>
            </v-col>
            <v-col>
              <v-card
                class="pa-2 red"
                outlined
              >
                col 3
              </v-card>
            </v-col>
            <v-col>
              <v-card
                class="pa-2 red"
                outlined
              >
                col 4
              </v-card>
            </v-col>
          </v-row>
        </v-col>
        <v-col>
          <v-card
            class="pa-2 green"
            outlined
          >
            col 5
          </v-card>
        </v-col>
        <v-col>
          <v-card
            class="pa-2 green"
            outlined
          >
            col 6
          </v-card>
        </v-col>
        <v-col cols="12">
          <v-card
            class="pa-2 green"
            outlined
          >
            col 7
          </v-card>
        </v-col>
      </v-row>
    </v-container>
  </v-app>
</template>

<script>
  import { h } from 'vue'

  export default {
    components: {
      VCard: (props, { slots }) => h('div', slots.default?.()),
    },
  }
</script>

@KaelWD KaelWD added this to the v3.0.0 milestone Dec 22, 2020
@KaelWD KaelWD self-assigned this Dec 22, 2020
@MajesticPotatoe MajesticPotatoe added C: VGrid Covers issues involving VContainer, VLayout, VFlex T: feature A new feature labels Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VGrid Covers issues involving VContainer, VLayout, VFlex T: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants