少不告诉我它的错误

编程入门 行业动态 更新时间:2024-10-28 08:31:29
本文介绍了少不告诉我它的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在使用客户端编译较少的内容时,如果存在错误,Less不会向我显示这些错误是什么.应该插入一些HTML,但是似乎没有这样做. Less运行后,页面上的HTML看起来像:

When using client-side compilation for less, and if there are errors, Less is not showing me what those errors are. It's supposed to insert some HTML, but it seems not to be doing this. The HTML on the page after Less runs looks like:

<html> <head> <link rel="stylesheet/less" type="text/css" href="/Content/less/all.less"> <script src="/Content/js/libs/less-1.3.0.min.js" type="text/javascript"></script> <style type="text/css" media="screen" id="less:error-message"> --SNIP-- }</style> </head> <body> </body> </html>

如您所见,生成的错误css更少,但是html却没有.

As you can see, the less error css is generated, but not the html.

推荐答案

在将less.js包含在脑海中之前,请添加以下脚本:

Add this script before including less.js in your head:

<script type="text/javascript">less = { env: 'development' };</script>

这告诉less.js,可以在浏览器中显示错误消息,因为我们仍在设计页面.

This tells less.js that it is OK to display error messages in the browser as we are still dev'ing the page.

更多推荐

少不告诉我它的错误

本文发布于:2023-07-26 11:49:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1216031.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:告诉我   错误

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!