Meteor 和 Ionic css 未应用

Meteor and Ionic css not applied

我想使用 meteoric package to create a very simple app with meteor and the ionic framework. Using the guide,我创建了以下非常简单的应用程序:

Router.js:

Router.configure({
  layoutTemplate: 'layout'
});

Router.route('/', function () {
  this.render('MyTemplate');
});

Templates.html:

<template name="layout">
    {{#ionBody}}
        {{> ionNavBar}}

        {{#ionNavView}}
            {{> yield}}
        {{/ionNavView}}

    {{/ionBody}}
</template>

<template name="myTemplate">
    {{#ionContent}}
        Hello World!
    {{/ionContent}}
</template>

应用加载没有错误,显示内容 "Hello World!" 完全没有任何样式。例如,为什么没有显示 iosNavBar?

查看ionic-sass的安装说明: https://github.com/meteoric/ionic-sass

它说:

in your app's .scss file:

@import '.meteor/local/build/programs/server/assets/packages/meteoric_ionic-sass/ionic';

因此,在您的流星应用程序中,使用上述导入语句创建一个 style.scss 文件。现在您应该看到正确应用的样式。

对于那些仍然发现缺少图标的人,请添加第二行以导入 ionicons

@import '.meteor/local/build/programs/server/assets/packages/meteoric_ionic-sass/ionic';

@import '.meteor/local/build/programs/server/assets/packages/meteoric_ionicons-sass/ionicons';

示例应用参考 link https://github.com/meteoric/contacts/blob/master/client/stylesheets/app.scss