在meteor中找不到模块'../../client/components/layouts/home.jsx'

时间:2016-05-27 08:01:49

标签: javascript node.js meteor reactjs

我今天第一次学习流星框架。我安装了react react-dom和react-mounter通过npm而不是atmospherejs.I我遇到了一个问题,说无法找到模块'../../client/components/layouts/home.jsx'。我不认为路径中有错误。因为我的routing.jsx位于lib目录内的路由目录中,而home.jsx位于客户端目录的components子目录内的layouts目录中。

lib - routing - routes.jsx
client - components - layouts - home.jsx

projectLayout

routes.jsx

import React from 'react';
import {mount} from 'react-mounter';
import HomeLayout from '../../client/components/layouts/home.jsx';
import Layout from '../../client/components/layouts/layout.jsx';

publicRoutes = FlowRouter.group({
    name:'publicroutes'
});

privateRoutes = FlowRouter.group({
    name:'privateroutes'
});

publicRoutes.route('/',{
    name:'Home',
    action(){
        mount(
                HomeLayout, {}
            )
    }
});

publicRoutes.route('/dashboard',{
    name:'Dashboard',
    action(){
        mount(Layout,{
            sidebar:<div>Sidebar</div>,
            content:<div>Content</div>
        })
    }
});

home.jsx

import React, { Component } from 'react';

export default class HomeLayout extends Component{
    render(){
        return(
                <div className="container">
                    <div className="row">
                        <div className="col-md-6">
                            Features
                        </div>
                        <div className="col-md-6 col-md-offset-1">
                            Signup
                        </div>
                    </div>
                </div>
            );
    }
}

可能是什么原因?

0 个答案:

没有答案