airyland / vux

Mobile UI Components based on Vue & WeUI
https://vux.li
MIT License
17.59k stars 3.71k forks source link

flexBox和tabbar之类带index.js的文件引入之后说我没有注册这个组件 #519

Closed RenShine closed 8 years ago

RenShine commented 8 years ago

报错信息如下 vue.common.js?1090:1019 [Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

代码如下

<template>
    <ul>
        <flex-box>
            <img src="" alt="假装有图" />
            <p>
               假装有商品名称
            </p>
        </flex-box>
    </ul>
</template>

<script>
    import {FlexBox} from "vux-components/flexbox"
    export default {
        components: {
            FlexBox
        }
    }
</script>

<style >

</style>
airyland commented 8 years ago

带有子组件的统一这样引入。

import { Flexbox, FlexboxItem } from 'vux-components/flexbox'
import { Tabbar, TabbarItem } from 'vux-components/tabbar'