zoukankan      html  css  js  c++  java
  • Mixin result declared without body

    1、错误描述

    F:dojoabcdabccviewsmainmain.pug:10:1 8| include header.pug 9| div(id='main') > 10| mixin result --------^ 11| ui 12| li #{result.user_name} 13| include left.pug Mixin result declared without body
    Error: F:dojoabcdabccviewsmainmain.pug:10:1
        8| include header.pug
        9| div(id='main')
      > 10| mixin result
    --------^
        11| ui
        12| li #{result.user_name}
        13| include left.pug
    
    Mixin result declared without body
        at makeError (F:dojoabcdabcc
    ode_modulespug-errorindex.js:32:13)
        at Parser.error (F:dojoabcdabcc
    ode_modulespug-parserindex.js:53:15)
        at Parser.parseMixin (F:dojoabcdabcc
    ode_modulespug-parserindex.js:871:12)
        at Parser.parseExpr (F:dojoabcdabcc
    ode_modulespug-parserindex.js:204:21)
        at Parser.parse (F:dojoabcdabcc
    ode_modulespug-parserindex.js:112:25)
        at parse (F:dojoabcdabcc
    ode_modulespug-parserindex.js:12:20)
        at Object.parse (F:dojoabcdabcc
    ode_modulespuglibindex.js:126:22)
        at Function.loadString [as string] (F:dojoabcdabcc
    ode_modulespug-loadindex.js:45:21)
        at compileBody (F:dojoabcdabcc
    ode_modulespuglibindex.js:86:18)
        at Object.exports.compile (F:dojoabcdabcc
    ode_modulespuglibindex.js:243:16)

    2、错误原因

    doctype html
    html
    head 
    style
    link(rel='stylesheet', href='../../stylesheets/main.css')
    body
    block content
    include header.pug
    div(id='main')
    mixin result
    ui
    li #{result.user_name}
    include left.pug
    router.get('/main',function(req,res){
      var conn = mysql.createConnection({
        host: 'localhost',
        user: 'root',
        password: 'root',
        database: 'cdm'
      });
    
      conn.connect();
      conn.query('select * from b_user',function(error,results,fields){
        if(error) throw error;
        console.log(results);
        res.render('main/main',{result:results});
      });
      
    });

    3、解决办法

  • 相关阅读:
    进程与线程
    闭包
    form表单提交
    让图片在div盒子中水平垂直居中
    第一个shell脚本——修改配置文件
    Linux系统find命令的常用方法
    Linux使echo命令输出结果带颜色
    Linux面试题
    无人值守批量安装
    Linux系统PXE高效批量网络装机的配置
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13313737.html
Copyright © 2011-2022 走看看