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



  • 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>
    


  • <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…



  • 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?



  • Have come up with a solution for this

    :helper="question.qHelp"
    

Locked