首页 文章
  • 1 votes
     answers
     views

    在玉器中,无法获得@ font-face的风格

    从一个工作的CSS文件(由font-squirrel生成): @font-face { font-family: 'SnowTopCaps'; src: url('/fonts/snowtopcaps-webfont.eot'); src: url('/fonts/snowtopcaps-webfont.eot?#iefix') format('embedded-opentype'...
  • 0 votes
     answers
     views

    模态中的Bootstrap表单不提交

    单击'submit'时,表单不响应(并且没有任何内容发送到服务器) . 我暂时从随机网站将表单的值设置为GET . 关闭按钮正确关闭模态 . 我工作了this example html body #editModal.modal.fade(tabindex="-1", role="dialog", aria-labe...
  • 1 votes
     answers
     views

    帕格(玉)中的错误不显示布局中的内容

    嗨伙计们,我最近开始哈巴狗(玉),我无法加载我的布局 这是我的layout.pug html(lang='en') head title hi link(rel='stylesheet', type='text/css', href='../public/css/W3.css') link(rel='stylesheet', href='https://fonts.goo...
  • 1 votes
     answers
     views

    不是webpack文件的pug编译器?

    运行webpack-dev-server时出现错误模块构建失败:TypeError:text.forEach不是函数enter image description here 'use strict'; var webpack = require('webpack'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); ...
  • 0 votes
     answers
     views

    如何制作固定在屏幕顶部的响应式导航栏

    到目前为止,我只是成功地使导航栏固定,并且链接仅在设备上有些兼容 . 我想要这个效果,媒体查询强制菜单进入图像中包含的导航 . http://getbootstrap.com/examples/navbar-fixed-top/ . 我不喜欢bootstrap,我希望将来能够自己做这件事 . 有小费吗? 这是我的代码: 玉: head link(rel =“stylesheet”,href =...
  • 1 votes
     answers
     views

    Pug文件没有加载CSS

    我有一个快速项目设置 . 我正在使用Pug作为视图引擎 . 我的app.js中有以下几行, app.set('views', path.join(__dirname, './views')); app.set('view engine', 'pug'); app.use(express.static(path.join(__dirname, './public'))); 我在index.pug视...
  • 0 votes
     answers
     views

    我在快递js中将html转换为pug时遇到错误

    我是node.js的新手 . 我收到了这个错误 TypeError:/home/agile/projects/nodekb/views/index.pug:6 4 | h1# 5 | ul> 6 |每篇文章,我在文章7 | li = article.title无法读取eval中未定义的属性“length”(包装时的eval(/home/agile/projects/nodekb/node_...
  • 1 votes
     answers
     views

    你能用我的gulpfile.js帮我吗?我正努力让我的玉工作

    我真的不确定这有什么问题 . 当我告诉我julp jade命令我的终端说: SyntaxError:在Object.Module._extensions..js(module.js:550)的Module._compile(module.js:513:28)处的Object.exports.runInThisContext(vm.js:76:16)输入的意外结束:10)在Module.load(...
  • 1 votes
     answers
     views

    角度数据绑定不适用于Jade

    我写这个测试代码只是为了检查Angular是否正在使用Jade . layout.jade doctype html html head title #{title} link(rel='stylesheet', href='/stylesheets/style.css') body(ng-app='app') block content script(ty...
  • 1 votes
     answers
     views

    翡翠Sweetalert2

    我试图在jade模板文件中使用sweetalert2创建一个简单的示例 . 当我运行以下命令时,我会收到'Help Me'警报,但是当我到达 swal 行时,我会收到: ReferenceError:未定义swal html head title= title style. body { font-family: verdanna; ...
  • 0 votes
     answers
     views

    在node.js中填充具有变量值的javascript文件

    我使用 node.js , express.js 和 pug / jade . 在我的服务器中,我使用变量 pageId 填充视图 . 我在 pug 视图中使用此变量 script. document.addEventListener('DOMContentLoaded', function () { var pageId = '#{pageId}'; (...) 问...
  • 1 votes
     answers
     views

    为什么我不能在pug模板中使用内联alert()如果从“if condition”调用它?

    我在article中读到了我可以使用内联函数来定义它们 - var = function(...),但是当我编写代码时: - var tryit = function tryit(tasks) {alert('will not work')}; if tasks #adiv #{tryit(tasks)} 我收到此错误消息: if supervisor tryit ...
  • 0 votes
     answers
     views

    如何使用Node.js下载在pug中定义的文件(.docx)?

    当我点击按钮时,我正在尝试使用Node.js(Express)和PUG(我是Web开发新手)下载文件 . 目前我有一个搜索引擎,我可以使用res.zip下载满足查询的所有文件(它们存储在./Datablob/name_of_docx.docx中) . 我还渲染了一个表格,其中包含有关搜索查询的所有文件的信息 . 我想在此表中添加一个可以下载每个单独文件的“下载”按钮 . 我的表中有一个列文件,它为...
  • 0 votes
     answers
     views

    在load pug上调用javascript函数 - 使用param设置localStorage

    我试图做的是从一个pug模板调用一个JS函数,该模板将在 localStorage 上设置一个项目 . 此项的值将是传递给pug模板"token"的参数 . 过去也曾提出类似的问题,我从这些答案中汲取灵感,因为它们看似相似: Pug call js function from another file inside template Express / Jade / P...
  • 0 votes
     answers
     views

    节点js表示无效的csrf令牌

    我试图用csurf和csrf令牌保护我的节点js web应用程序 . 这里和网上都有很多例子,但不能让它们起作用 . 这是我的app.js var express = require('express'); var cookieParser = require('cookie-parser'); var csrf = require('csurf'); var bodyParser = requi...
  • 4 votes
     answers
     views

    Zurb Foundation Sticky Nav Bar

    所以我使用的是zurb基础框架中的默认 .top-bar 类,但我是'm failing a find a simple way to make the nav bar ' sticky'(跟随用户滚动),例如你可以使用Twitter bootstrap . 这是我的代码,我正在使用玉: nav.top-bar ul li.name h1 a(href='#...
  • 1 votes
     answers
     views

    在pug模板中使用/包含webpack捆绑资产

    这是我的场景: 我想在客户端(React)和服务器(Express)以及PostCSS for CSS中使用ES6 / 7,所以我需要webpack babel . 几个路由渲染页面托管React组件,一些(React组件)琐碎,一些重 . 我想用pug作为视图引擎,将整个应用程序放在一个SPA中不是一个选项 . 我的设置工作在开发模式(在我的哈巴狗模板中,我直接在build di...
  • 15 votes
     answers
     views

    jade模板里面的javascript函数执行

    我是nodejs的新手并尝试为html内容创建一个jade文件 myfile.jade :这是文件的内容: extends layout block content script function capitalize(s) { console.log("Testing js exec"); return s.charAt(0).t...
  • -1 votes
     answers
     views

    在bootstrap和哈巴狗的警报

    我想知道我是否理解了connect-flash / bootstrap / sessions的工作原理 . 我确实看到flash消息按预期显示 . 我的问题是与“成功”和“危险”相关的颜色 . 当消息按预期显示时,我没有看到相关的颜色, 以下是package.json的部分, { "dependencies": { "body-parser": ...
  • 1 votes
     answers
     views

    用javascript的PUG

    如果我有以下代码 script. function getProductParams(params) { return JSON.parse(localStorage.getItem(params)); } each product in products -var getVariable = getProductParams("ids&quot...
  • 49 votes
     answers
     views

    错误:无法在Express中查找视图

    Note :我在帖子末尾的自动回答 我正在尝试更好地体验nodeJS,我真的不想将所有脚本放在一个文件中 . 所以,按照这里的帖子我使用这个结构 ./ config/ enviroment.js routes.js public/ css/ styles.css images views index index.jade section...
  • 1 votes
     answers
     views

    从图表路由到bar1页面时出现404错误

    错误未找到404错误:在trim.preject(c:\ node \ nodetest1 \ app.js:48 | 15)的trim-prefix(c:\)处找不到Layer.app.use.res.render.message node \ nodetest1 \ node_modules \ express \ lib \ router \ index.js:240:15)在C:\ nod...
  • 0 votes
     answers
     views

    在使用Jade模板的Express应用程序中集成Angular有什么好方法?

    我是Node.js的新手,但是我想开始一个新项目,并且想到学习Node-Express框架和MEAN堆栈的好机会 . 令我困惑的是,如果上面提到的堆栈根据定义使用Angular,Express会附带Jade模板(*参见EDIT)引擎 . 事实上,我的理解是,尽管Jade可以与angular一起使用,但这可能是不必要的,可能只是过于复杂(例如参见this question) . 当然我可以看到Exp...

热门问题