网站前端
SVG、JavaScript、CSS、HTML、各种框架。Web前端开发是从美工演变而来的,名称上有很明显的时代特征。在互联网的演化进程中,Web 1.0时代,网站的主要内容都是静态的,用户使用网站的行为也以浏览为主。
各种各样的框架让人目不暇接,新技术层出不穷。让我们这些前端狗情何以堪。
目前web前端工程师的年薪待遇平均在10万以上,高级HTML前端工程师年薪达30—50万,很多企业对于与web前端相关的技术职位更是求贤若渴。
在 Angular 中 ngStyle 如何设置 background-image
2023年11月20日
最近在编写管理后台的时候,使用 Angular 加载图片,具体代码如下:<span class="symbol-label" style="background-image:url({{element.img_url}});"></span>但是编译器会出现错误提示。我们可以使用 Angular 中的 ngStyle,下面是修改后的写法:<span class="symbol-label" [ng...
ts 判断数组是否为空
2023年11月20日
在 TypeScript 中,您可以使用以下方法来判断数组是否为空:使用数组的 length 属性:const arr: number[] = []; if (arr.length === 0) { console.log("数组为空"); } else { console.log("数组不为空"); } 使用 Array.isArray() 方法:const arr: n...
Module not found: Error: Can't resolve 'sass-loader' in
2023年11月14日
今天在打包的时候出现了如下错误:Module not found: Error: Can't resolve 'sass-loader' in截图如下:出现问题的原因:可能是由于缓存造成的。解决方案:运行如下两个命令:npm install sass-loader -D npm install node-sass -D这两个命令是用于在Node.js项目中安装与Sass(Syntacticall...
页面过期相关问题
2023年11月09日
我们购物车中的商品已经结算了,但是我们通过浏览器后退按钮,还是会显示原来没有支付的商品,也就是页面没有过期,这个问题我们再项目中应该如何处理?处理页面过期的问题通常涉及到使用合适的前端和后端技术,以确保用户在购物车结算后不能通过浏览器后退按钮看到未支付的商品。以下是一些建议:1. 使用合适的状态管理: 在用户完成购物车结算后,确保相应的状态被正确更新。这可以通过前端框架(如React、Vue等)中...
(node:12364) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated. (Use `node --trace-deprecation ...` to show where the warning was created)
2023年10月26日
后台管理程序使用的是 Angular,Node.js 版本是 16.17.0,构建的时候出现了如下警告:- Generating browser application bundles...(node:12364) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated. (Use ...
html 页面 svg 是否应该省略 xmlns 属性
2023年09月20日
我们在 html 页面加入 svg 的时候,可以直观的显示图像,同时可以与 JavaScript 交互,下面是一个 html 中 svg 的例子:<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M11.1359 4.48359C11...
classList.toggle 理解
2023年09月04日
最近在判断某个元素是否存在 class=“xxx” 的值,例如下面这种写法:if (targetElement) { // Toggle the 'd-none' class to show/hide if (targetElement.classList.contains('d-none')) { targetElement.classList.remove...
如何移除 input type="number" 时浏览器自带的上下箭头?
2023年08月28日
最近在使用 input 数字输入的时候,总是会出现一个上下箭头,截图如下:如果这个不明显,可以看这个:具体代码如下:<input id="quantity" type="number" class="qty border-0" name="quantity" max="10" step="1" pattern="[0-9]*" value="1" size="4" min="1">如果要去掉 in...