B
B
BonBon Slick2017-10-13 18:36:13
Vue.js
BonBon Slick, 2017-10-13 18:36:13

Validation with Vue?

<input type="text" required v-model="message">
      <div class="error" v-show="!msgValid">
                <span style="color:red;">Input is Invalid</span>
     </div>

vue
new Vue({
    el: '#forms',
    data: {
          message: ''
      },
    computed: {
        isFioValid: function () {
          // ???
        }
    }
});

How to validate and display the appropriate message using Vue.js?
Or is there a library, a ready-made solution to use?

From the example above, SQL, XSS injections should be avoided.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Koch, 2017-10-13
@BonBonSlick

SQL, XSS Frontend injections are unavoidable.
Do validation on the server.
But if you want to warn the user that the server will not accept the response:
https://github.com/vuejs/awesome-vue#validation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question