最近的文章列表

Warning: K: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

 Warning: K: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

警告:K:在未来的主要版本中,将从功能组件中删除对defaultProps的支持。请改用JavaScript默认参数。

...
2024/1/26 Comments:
自定义组件ref不支持字符串名称:Function components cannot have string refs in React

 The error "Function components cannot have string refs" occurs when we use a string as a ref in a function component.

To solve the error use the useRef() hook to get a mutable ref object that you can use as a ref inside of the component.

...
2024/1/26 Comments:
vue2 对watch的使用 监听数据 并包含$store.store 数据变化的监听

 Vue watch 实现监听数据改变

...
2024/1/17 Comments:
Uncaught SecurityError: Failed to read a named property 'href' from 'Location': Blocked a frame with origin "http://localhost:9529" from accessing a cross-origin frame.

 Uncaught SecurityError: Failed to read a named property 'href' from 'Location': Blocked a frame with origin "http://localhost:9529" from accessing a cross-origin frame.

    at ./src/main.js (main.js:127:23)

...
2024/1/13 Comments:
vue build报错:Could not find a declaration file for module '../package/dist/vue-web-component-wrapper.es.js'. /package/dist/vue-web-component-wrapper.es.js' implicitly has an 'any' type

 D:\Camnpr git:[dev]

npm run build

> vite1@1.0.0 build

> pnpm run type-check && pnpm run build-only

> vite1@1.0.0 type-check D:\Camnpr 

> vue-tsc --noEmit

src/main.ts:10:33 - error TS7016: Could not find a declaration file for module '../package/dist/vue-web-component-wrapper.es.js'. 'D:/Camnpr/package/dist/vue-web-component-wrapper.es.js' implicitly has an 'any' type.

...
2024/1/13 Comments:
vue-tsc --noEmi 报错 Search string not found: "/supportedTSExtensions = .*(?=;)/"

 > vue-tsc --noEmit

D:\WorkSpace\xxx\node_modules\vue-tsc\bin\vue-tsc.js:68

                        throw err;

                        ^

...
2024/1/13 Comments:
webpack入门——webpack 配置

传一个配置对象给webpack ,它就可以干活儿了。根据你用webpack的用法,有两种途径传入这个对象:

CLI( 命令行)

如果你用命令行,命令行会读取一个叫webpack.config.js(或者用 –config 选项传入的一个配置文件)的文件。这个文件应该导出一个配置对象,如下:

module.exports = {     // configuration };
...
2018/5/30 Comments:
Weex 快速了解和入门 构建高性能的Native APP

 

2c450000d310db0456a5

...
2017/12/6 Comments:
自由组合的倒计时库:jQuery.countdown.js

 我们都知道,在一些促销商品上、拍卖、优惠券等,都会有时效性,为了促销吸引眼球,会加一个倒计时来时刻提醒顾客:想买要抓紧了,时间不等人。那么作为前端开发的我们,要怎么来实现这个倒计时呢?

...
2017/6/7 Comments:
javascript防劫持-防止网页被Frame-Content Security Policy-添加integrity属性

什么是javascript劫持

javascript劫持属于HTTP劫持中的一种,主要是劫持js文件,然后在网页中通过js脚本往网页中注入图片和链接或者框架广告,也叫流量劫持。 文明一点的劫持只是右下角放一个固定广告,不文明的就自动弹出新广告窗口(一般会被浏览器拦截)或者给整个网页添加点击事件弹出新广告页面。

javascript劫持套路

1、document.write注入

2017/1/5 Comments: