No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. vijayganeshpk
    V
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Best 1
    • Groups 0

    vijayganeshpk

    @vijayganeshpk

    1
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    vijayganeshpk Follow

    Best posts made by vijayganeshpk

    • RE: default style

      This is a valid use case for which a more elegant option from the framework would be helpful.

      For our requirement, we wanted all controls to be flat and bordered, so we went ahead with the following solution:

      // commattribs.js
      export default {
         flat: true,
         bordered: true
      }
      

      then customized individual components that we use to make use of the above attributes:

      <template>
        <q-card
          v-bind="attrs"
          v-on="$listeners"
        >
          <template
            v-for="(_, slot) of $scopedSlots"
            v-slot:[slot]="scope"
          >
            <slot
              :name="slot"
              v-bind="scope"
            />
          </template>
        </q-card>
      </template>
      
      <script>
      import cattribs from './comm-attribs'
      export default {
        name: 'ACard',
        computed: {
          attrs () {
            return {
              ...cattribs,
              ...this.$attrs
            }
          }
        }
      }
      </script>
      

      so if we needed to customize all components with some other attribute, we change them up in commattribs.js

      posted in Framework
      V
      vijayganeshpk

    Latest posts made by vijayganeshpk

    • RE: default style

      This is a valid use case for which a more elegant option from the framework would be helpful.

      For our requirement, we wanted all controls to be flat and bordered, so we went ahead with the following solution:

      // commattribs.js
      export default {
         flat: true,
         bordered: true
      }
      

      then customized individual components that we use to make use of the above attributes:

      <template>
        <q-card
          v-bind="attrs"
          v-on="$listeners"
        >
          <template
            v-for="(_, slot) of $scopedSlots"
            v-slot:[slot]="scope"
          >
            <slot
              :name="slot"
              v-bind="scope"
            />
          </template>
        </q-card>
      </template>
      
      <script>
      import cattribs from './comm-attribs'
      export default {
        name: 'ACard',
        computed: {
          attrs () {
            return {
              ...cattribs,
              ...this.$attrs
            }
          }
        }
      }
      </script>
      

      so if we needed to customize all components with some other attribute, we change them up in commattribs.js

      posted in Framework
      V
      vijayganeshpk