2

I create a component with input properties:

export default {
    data() {
       :
       :
    },     
    props: {
        rowsContent: {
            type: Object,
            default: null,
            validator: function(value) {
                console.log("In validator");
            }

        },
        rowsPerPage: {
            type: Number,
            default: 10,
        },
    }

I tried to pass different type of parameters, and got no error message.
Moreover, no "In validator" message is printed to console.

Any idea?

guyaloni
  • 4,972
  • 5
  • 52
  • 92

1 Answers1

3

I don't know the reason, but it is working if I use component tag like <tag></tag>. If I use like <tag/>, it does not work. See example here. https://codesandbox.io/s/z6rlzl998p

EDIT: Vue does not support self-closing tags as components: https://github.com/vuejs/vue/issues/8664 (as mentioned in comment)

Nafees Anwar
  • 6,324
  • 2
  • 23
  • 42
  • Vue [does not support self-closing tags](https://github.com/vuejs/vue/issues/8664) as components (because with a few historical exceptions [self-closing html tags are not valid HTML5](https://stackoverflow.com/a/3558200/3412322).) – Daniel Beck Jan 02 '19 at 17:06