How to use properties of a Component in vue.js when input text changed?React to property changes in JSON object using recursive components in Vue.jsVue.js pass data from slot into component instanceVue.js where to store non-component data properties?Vue.Js Multiple inputs with different typesAccessing and filtering child components defined in a Vue.js component's <slot>Vue.js 2 Multiple Properties defined in one Single-File componentvue.js - dynamically generated component in v-for does not update bound property correctlyUse @input or @change on input with value of computed propertyVue child component property does not workProps don't update when input changes in component

Do creatures with a listed speed of "0 ft., fly 30 ft. (hover)" ever touch the ground?

Forgetting the musical notes while performing in concert

Ambiguity in the definition of entropy

What are the G forces leaving Earth orbit?

Does Dispel Magic work on Tiny Hut?

What is the most common color to indicate the input-field is disabled?

Was the old ablative pronoun "med" or "mēd"?

Was the Stack Exchange "Happy April Fools" page fitting with the '90's code?

Theorists sure want true answers to this!

What is the opposite of "eschatology"?

How to travel to Japan while expressing milk?

Can someone clarify Hamming's notion of important problems in relation to modern academia?

In the UK, is it possible to get a referendum by a court decision?

Is there a hemisphere-neutral way of specifying a season?

One verb to replace 'be a member of' a club

my venezuela girlfriend wants to travel the USA where i live.what does she need to do and how expensive will it become or how difficult?

Mathematica command that allows it to read my intentions

Fair gambler's ruin problem intuition

What's the meaning of "Sollensaussagen"?

Why were 5.25" floppy drives cheaper than 8"?

How to Prove P(a) → ∀x(P(x) ∨ ¬(x = a)) using Natural Deduction

Does the Idaho Potato Commission associate potato skins with healthy eating?

Why do I get negative height?

Different meanings of こわい



How to use properties of a Component in vue.js when input text changed?


React to property changes in JSON object using recursive components in Vue.jsVue.js pass data from slot into component instanceVue.js where to store non-component data properties?Vue.Js Multiple inputs with different typesAccessing and filtering child components defined in a Vue.js component's <slot>Vue.js 2 Multiple Properties defined in one Single-File componentvue.js - dynamically generated component in v-for does not update bound property correctlyUse @input or @change on input with value of computed propertyVue child component property does not workProps don't update when input changes in component













0















I'm using Vuesax Framework Components which it's working fine, but my in learning process for both laravel/vue.js and got a problem about how to use properties of component when input text got changed?



Consider this :



<vs-input
style="width:100%"
label="Label"
danger-text="character"
v-model="form.invoice_title"
name="invoice_title"/>


in top code component gonna show me a input text with a red color with text which will tell use what is wrong, but in right idea i should make that red color show when something is wrong with inputs, like `input must be more than 3 Characters'.
Input Component in vuesax



So here's what i wanna do make my input activate/trigger :danger & danger-text properties when something is wrong Like:



inputs must be more than 6 and less than 80 characters.










share|improve this question


























    0















    I'm using Vuesax Framework Components which it's working fine, but my in learning process for both laravel/vue.js and got a problem about how to use properties of component when input text got changed?



    Consider this :



    <vs-input
    style="width:100%"
    label="Label"
    danger-text="character"
    v-model="form.invoice_title"
    name="invoice_title"/>


    in top code component gonna show me a input text with a red color with text which will tell use what is wrong, but in right idea i should make that red color show when something is wrong with inputs, like `input must be more than 3 Characters'.
    Input Component in vuesax



    So here's what i wanna do make my input activate/trigger :danger & danger-text properties when something is wrong Like:



    inputs must be more than 6 and less than 80 characters.










    share|improve this question
























      0












      0








      0








      I'm using Vuesax Framework Components which it's working fine, but my in learning process for both laravel/vue.js and got a problem about how to use properties of component when input text got changed?



      Consider this :



      <vs-input
      style="width:100%"
      label="Label"
      danger-text="character"
      v-model="form.invoice_title"
      name="invoice_title"/>


      in top code component gonna show me a input text with a red color with text which will tell use what is wrong, but in right idea i should make that red color show when something is wrong with inputs, like `input must be more than 3 Characters'.
      Input Component in vuesax



      So here's what i wanna do make my input activate/trigger :danger & danger-text properties when something is wrong Like:



      inputs must be more than 6 and less than 80 characters.










      share|improve this question














      I'm using Vuesax Framework Components which it's working fine, but my in learning process for both laravel/vue.js and got a problem about how to use properties of component when input text got changed?



      Consider this :



      <vs-input
      style="width:100%"
      label="Label"
      danger-text="character"
      v-model="form.invoice_title"
      name="invoice_title"/>


      in top code component gonna show me a input text with a red color with text which will tell use what is wrong, but in right idea i should make that red color show when something is wrong with inputs, like `input must be more than 3 Characters'.
      Input Component in vuesax



      So here's what i wanna do make my input activate/trigger :danger & danger-text properties when something is wrong Like:



      inputs must be more than 6 and less than 80 characters.







      vue.js vuejs2 vue-component






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 8 at 21:11









      Mohammad EskandariMohammad Eskandari

      4710




      4710






















          1 Answer
          1






          active

          oldest

          votes


















          1














          This can be done via a computed property. eg:



          <vs-input
          style="width:100%"
          label="Label"
          :danger="hasError"
          :danger-text="errorText"
          v-model="form.invoice_title"
          name="invoice_title"/>

          ... // in javascript

          computed()
          hasError()
          return this.form.invoice_title.length < 6
          errorText()
          if (this.form.invoice_title.length < 6)
          return 'Invoice title should be at least 6 characters'

          if (this.form.invoice_title.length > 80)
          return 'Invoice title should be at most 80 characters'

          return ''




          I highly recommend vuelidate lib form managing validation






          share|improve this answer























          • hasError work but errorText won't work. computed method when inputs go wrong it just say errorText

            – Mohammad Eskandari
            Mar 9 at 17:29






          • 1





            note that I used a colon (:) that designates it's a bound property, alias to v-bind:danger-text. If you don't it will just use the variable you give it as text.

            – Andy
            Mar 12 at 21:27











          • oh. i've got it done. thanks mate.

            – Mohammad Eskandari
            Mar 15 at 3:35











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55071048%2fhow-to-use-properties-of-a-component-in-vue-js-when-input-text-changed%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          This can be done via a computed property. eg:



          <vs-input
          style="width:100%"
          label="Label"
          :danger="hasError"
          :danger-text="errorText"
          v-model="form.invoice_title"
          name="invoice_title"/>

          ... // in javascript

          computed()
          hasError()
          return this.form.invoice_title.length < 6
          errorText()
          if (this.form.invoice_title.length < 6)
          return 'Invoice title should be at least 6 characters'

          if (this.form.invoice_title.length > 80)
          return 'Invoice title should be at most 80 characters'

          return ''




          I highly recommend vuelidate lib form managing validation






          share|improve this answer























          • hasError work but errorText won't work. computed method when inputs go wrong it just say errorText

            – Mohammad Eskandari
            Mar 9 at 17:29






          • 1





            note that I used a colon (:) that designates it's a bound property, alias to v-bind:danger-text. If you don't it will just use the variable you give it as text.

            – Andy
            Mar 12 at 21:27











          • oh. i've got it done. thanks mate.

            – Mohammad Eskandari
            Mar 15 at 3:35















          1














          This can be done via a computed property. eg:



          <vs-input
          style="width:100%"
          label="Label"
          :danger="hasError"
          :danger-text="errorText"
          v-model="form.invoice_title"
          name="invoice_title"/>

          ... // in javascript

          computed()
          hasError()
          return this.form.invoice_title.length < 6
          errorText()
          if (this.form.invoice_title.length < 6)
          return 'Invoice title should be at least 6 characters'

          if (this.form.invoice_title.length > 80)
          return 'Invoice title should be at most 80 characters'

          return ''




          I highly recommend vuelidate lib form managing validation






          share|improve this answer























          • hasError work but errorText won't work. computed method when inputs go wrong it just say errorText

            – Mohammad Eskandari
            Mar 9 at 17:29






          • 1





            note that I used a colon (:) that designates it's a bound property, alias to v-bind:danger-text. If you don't it will just use the variable you give it as text.

            – Andy
            Mar 12 at 21:27











          • oh. i've got it done. thanks mate.

            – Mohammad Eskandari
            Mar 15 at 3:35













          1












          1








          1







          This can be done via a computed property. eg:



          <vs-input
          style="width:100%"
          label="Label"
          :danger="hasError"
          :danger-text="errorText"
          v-model="form.invoice_title"
          name="invoice_title"/>

          ... // in javascript

          computed()
          hasError()
          return this.form.invoice_title.length < 6
          errorText()
          if (this.form.invoice_title.length < 6)
          return 'Invoice title should be at least 6 characters'

          if (this.form.invoice_title.length > 80)
          return 'Invoice title should be at most 80 characters'

          return ''




          I highly recommend vuelidate lib form managing validation






          share|improve this answer













          This can be done via a computed property. eg:



          <vs-input
          style="width:100%"
          label="Label"
          :danger="hasError"
          :danger-text="errorText"
          v-model="form.invoice_title"
          name="invoice_title"/>

          ... // in javascript

          computed()
          hasError()
          return this.form.invoice_title.length < 6
          errorText()
          if (this.form.invoice_title.length < 6)
          return 'Invoice title should be at least 6 characters'

          if (this.form.invoice_title.length > 80)
          return 'Invoice title should be at most 80 characters'

          return ''




          I highly recommend vuelidate lib form managing validation







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 9 at 7:07









          AndyAndy

          5,38022019




          5,38022019












          • hasError work but errorText won't work. computed method when inputs go wrong it just say errorText

            – Mohammad Eskandari
            Mar 9 at 17:29






          • 1





            note that I used a colon (:) that designates it's a bound property, alias to v-bind:danger-text. If you don't it will just use the variable you give it as text.

            – Andy
            Mar 12 at 21:27











          • oh. i've got it done. thanks mate.

            – Mohammad Eskandari
            Mar 15 at 3:35

















          • hasError work but errorText won't work. computed method when inputs go wrong it just say errorText

            – Mohammad Eskandari
            Mar 9 at 17:29






          • 1





            note that I used a colon (:) that designates it's a bound property, alias to v-bind:danger-text. If you don't it will just use the variable you give it as text.

            – Andy
            Mar 12 at 21:27











          • oh. i've got it done. thanks mate.

            – Mohammad Eskandari
            Mar 15 at 3:35
















          hasError work but errorText won't work. computed method when inputs go wrong it just say errorText

          – Mohammad Eskandari
          Mar 9 at 17:29





          hasError work but errorText won't work. computed method when inputs go wrong it just say errorText

          – Mohammad Eskandari
          Mar 9 at 17:29




          1




          1





          note that I used a colon (:) that designates it's a bound property, alias to v-bind:danger-text. If you don't it will just use the variable you give it as text.

          – Andy
          Mar 12 at 21:27





          note that I used a colon (:) that designates it's a bound property, alias to v-bind:danger-text. If you don't it will just use the variable you give it as text.

          – Andy
          Mar 12 at 21:27













          oh. i've got it done. thanks mate.

          – Mohammad Eskandari
          Mar 15 at 3:35





          oh. i've got it done. thanks mate.

          – Mohammad Eskandari
          Mar 15 at 3:35



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55071048%2fhow-to-use-properties-of-a-component-in-vue-js-when-input-text-changed%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

          Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

          2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived