FranckFreiburger / http-vue-loader

load .vue files from your html/js
MIT License
1.48k stars 273 forks source link

components expected an Object, but got Array. #88

Closed gtfd333 closed 3 years ago

gtfd333 commented 4 years ago

use example:

...
<script type="text/javascript">

    httpVueLoader.register(Vue, 'my-component.vue');

    new Vue({
        components: [
            'my-component'
            ]
        },
        ...
error
vue.js:597 [Vue warn]: Invalid component name: "0". Component names can only contain alphanumeric characters and the hyphen, and must start with a letter.
warn @ vue.js:597
validateComponentName @ vue.js:1343
checkComponents @ vue.js:1337
mergeOptions @ vue.js:1457
Vue._init @ vue.js:4598
Vue @ vue.js:4716
(anonymous) @ index.html?_ijt=svmlnlo0241ksem7p21j8hcdmg:24
vue.js:597 [Vue warn]: Invalid value for option "components": expected an Object, but got Array.

(found in <Anonymous>)

then i use:

    httpVueLoader.register(Vue, 'my-component.vue');

    new Vue({
        },
        ...

it works