首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何将pugjs (jade-lang)与Ember-CLI集成?

如何将pugjs (jade-lang)与Ember-CLI集成?
EN

Stack Overflow用户
提问于 2016-09-20 18:08:45
回答 1查看 622关注 0票数 0

我是npm的新手。

我下载了ember-cli来设计一个应用程序,但我也想安装pugjs来渲染html。

所以..。我不需要写很多不必要的html代码。

那么有没有办法把pugjs (jade-lang)和Ember-CLI集成起来呢?

提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2016-09-22 09:56:30

您需要添加Broccoli编译器并在此处加载以获取更多信息,请查看以下资源:

1- https://github.com/sindresorhus/broccoli-jade

2- https://www.npmjs.com/package/generator-ember-jade-zurb-express //Yoeman generator which may help you to scaffold your project.

但是,我强烈建议您使用emblemjs。该项目的概述如下:

代码语言:javascript
复制
    p Introducing Emblem.js: a new templating language
      that compiles to Handlebars.js

    ul
      li Indentation-based (like Slim, Jade, HAML, etc.)
      li Compiles to Handlebars

; full compatibility with
     both custom and built-in Handlebars helpers
  li Ember.js-friendly syntax and full compatibility
     with auto-updating functionality.

/ Emblem is HTML5-aware; Render HTML if a line starts with
  known HTML tag, else invoke HB helper or perform property lookup.
  These defaults are easily overridable when necessary.
ul
  each person in people
    li = person.name

section.ember-features
  / easy, natural Ember bindAttr support
  h1 class=foo The class name of this element is bound to `foo`
  p class=isActive:flashing:inactive Ember.js bound css classes

  / implicit Ember action handlers
  a click="doIt" href="#" Hello, how are you doing, #{name}?

/ condense nested content into a single line if that's how you roll
#footer: ul.menu-items: each menu_items: li: a.menu-link href=url: link_text

if something
  p something was true!
else 
  p something was false!
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39591314

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档