vuejs / vue

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
http://v2.vuejs.org
MIT License
207.71k stars 33.68k forks source link

Expected Array, got String. #1672

Closed ghost closed 8 years ago

ghost commented 8 years ago

how to add array on props..

I have try this

<hisoft-data tabs="array('a', 'b')"></hisoft-data>

and this

<hisoft-data tabs="['a', 'b']"></hisoft-data>

and still got an error.. Expected Array, got String.

this my component

Vue.component('hisoft-data', {
    template    : '#hitemp-data',
    props       : {
        'tabs'  : Array,
    },
    ready       : function(){
        console.log( this.tabs );
    },
    methods     : {
        callAdd : function(){
            this.$dispatch('add-data');
        },
        callFind: function(){
            this.$dispatch('find-data');
        },
    }
});
simplesmiler commented 8 years ago

Something like this:

<hisoft-data v-bind:tabs="['a', 'b']"></hisoft-data>

Please use chat or forum for questions.

ghost commented 8 years ago

yes.. thanks.