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

    Set default attributes on QInput?

    Help
    2
    2
    332
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      Vegedus last edited by

      So basically, we’ve decided we want to always use the “Outlined” style of QInput. I’d like to set this as a default, so every QInput ever doesn’t have to have added the outline attribute to the component. What’s the best way to do this? All my googling turns up that you can do something like Notify.setDefaults(), but I can’t that to work for QInput. Should I simply edit the Stylus? I might want to set defaults for other quasar components as well, I’m still setting up the project, but QInput is the most important one for now.

      1 Reply Last reply Reply Quote 0
      • metalsadman
        metalsadman last edited by metalsadman

        Wrap a qinput component with your desired props, then use that component throughout your app.

        //myinput.vue
        <template>
          <q-input outlined ... />
        ....
        
        // someform.vue
        import MyInput from '.../myinput.vue'
        
        <template>
          <my-input ... />
        
        1 Reply Last reply Reply Quote 1
        • First post
          Last post