警告:出现意外的块“脚本".玉 [英] Warning: Unexpected block "scripts" Jade
本文介绍了警告:出现意外的块“脚本".玉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我写了一个玉文件,如下所示:
I wrote a jade file as shown below:
extends layout
block content
h1= title
p Welcome 123 to #{title}
block scripts
script(src='/socket.io/socket.io.js')
script(src='/javascripts/client.js')
但是,当我运行时,出现以下警告:警告:意外的块脚本"从未使用过此块.此警告将是v2.0.0中的错误
However when I run I get the following Warning: Warning: Unexpected block "scripts" This block is never used. This warning will be an error in v2.0.0
我的Package.json文件具有玉器版本〜1.9.0
My Package.json file has jade version ~1.9.0
但是,当Jade版本为〜1.8.2
However this works when Jade version is ~1.8.2
可能是什么问题?
推荐答案
您应添加以下行:阻止脚本
到您的layout.jade文件.
You should add the line:
block scripts
to your layout.jade file.
这篇关于警告:出现意外的块“脚本".玉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文