- 博客(6)
- 收藏
- 关注
原创 vue父子组件之间的通信问题
父组件向子组件通信:在子组件中动态数据绑定父组件的数据,在子组件中使用props接收,然后在template中使用子组件向父组件通信子组件通过$emit触发父组件的自定义事件,兄弟组件之间的通信var bus = new Vue()// 在组件 B 绑定自定义事件bus.on(′id−selected′,function(id)//...)//触发组件A中的事件bus.on('id-selected', function (id) { // ...})// 触发组件 A
2022-01-10 11:04:12
334
原创 Error: ENOENT: no such file or directory解决方法
就是npm版本太低了,将npm版本升级一下就可以了
2021-08-14 16:03:49
19893
2
原创 封装一个格式化时间函数
function dateFormat(date, format) { if (typeof date === "string") { var mts = date.match(/(\/Date\((\d +)\)\/)/); if (mts && mts.length >= 3) { date = parseInt(mts[2]); } } date = new Date(date);.
2021-08-04 00:33:10
380
原创 如何更改checkbox的默认属性
先设置checkbox基本属性,注意给checkbox的appearance设置为none.itemCheck { position: relative; left: 10px; top: 14px; width: 25px; height: 25px; color: #fff; outline: none; background: #fff; -webkit-appearance: none;}给checkbox添加伪元
2021-07-26 18:40:03
845
原创 The value of the ‘Access-Control-Allow-Origin‘ header in the response must not be the wildcard问题
app.use('/', (req, res, next) => { res.header('Access-Control-Allow-Origin', req.header('Origin')); res.header('Access-Control-Allow-Method', 'get,post'); res.header('Access-Control-Allow-Credentials', true) next()})在跨域请求中携带Cookie的问题.
2021-05-13 13:33:40
805
原创 浏览器不渲染html而是返回html代码的问题
在用express框架创建服务器后,发现有时在服务器端访问html代码时,浏览器不进行解析而是直接显示了html代码,查了一下原因!在express框架中,官方推荐jade引擎,而我打开的html文件,渲染时就有可能会出现问题,不是全部都有问题,这个有待考究,说一下解决方法:在允许跨域时设置的app.all()中,将头部res.header('content-type')注释掉:app.all('*', function(req, res, next) { res.header("Ac
2021-04-11 16:22:29
1989
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人