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

    [Solved] Helper in Q-field. Can I use v-model?

    Help
    2
    4
    499
    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.
    • O
      Oxar last edited by Shone

      Hi

      I would like to know if the following is possible in quasar please:
      I create some questions using the model below.
      For each question, I’d like the user to input the string of a helper into the v-model=“questions.qHelp”. I want to then display the string in the helper in the div below.
      Since the type of the helper in the quasar docs is a string and I can’t use a v-model, is there a workaround for this? Thanks.

      questions: [
                  {
                    qtext: '',
                    qHelp: ''
                  }
               ]
      
                    <div v-for="(question, qIndex) in form.questions" :key="question.id">
                                      <q-field class="q-ml-md q-mt-md q-mb-md" label="Question: " helper ="something..." >
                                        <q-input v-model="question.qtext" type="textarea" rows="6" align="center" readonly/>
                                      </q-field>
      
      1 Reply Last reply Reply Quote 0
      • Hawkeye64
        Hawkeye64 last edited by Hawkeye64

        <div v-for="(question, qIndex) in form.questions" :key="question.id">
          <q-field class="q-ml-md q-mt-md q-mb-md" label="Question: " helper ="something..." >
            <q-input v-model="question.qtext" type="textarea" rows="6" align="center" readonly/>
            {{ question.qtext }}
          </q-field>
        

        But your input is readonly…

        1 Reply Last reply Reply Quote 0
        • O
          Oxar last edited by

          Thanks for the reply @Hawkeye64. I’ve used your suggestion as a work around currently.
          I think I should have explained myself better though. I have two tabs: 1 for inputting information (Pre) and 1 for displaying (Post), hence the readonly.
          In tab Pre, user can input the string question.qhelp for each individual question and for as many questions as needed.
          In tab Post, I wanted to use question.qhelp to substitute the string that’s contained in the helper of the field.
          so instead of

          helper ="something..." 
          

          something more like

          helper = question.qtext 
          

          Is that possible or your suggestion the only way for now?

          1 Reply Last reply Reply Quote 0
          • O
            Oxar last edited by

            Have come up with a solution for this

            :helper="question.qHelp"
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post