【Immer】不可变数据结构通过永不更改状态对象来解决这个问题。与 Vue 不同的是,它会创建一个新对象,保留旧的对象未发生改变的一部分。在 JavaScript 中有多种不同的方式来使用不可变数据,但我们推荐使用 Immer 搭配 Vue,因为它使你可以在保持原有直观、可变的语法的同时,使用不可变数据。

JustAuth: 开箱即用的整合第三方登录的开源组件

sshpass 一个简单、轻量级命令行工具,提供非交互式密码验证

Non-function value encountered for default slot. Prefer function slots
Non-function value encountered for default slot. Prefer function slots
问题原因:
Vue3 使用h函数 推荐使用函数式插槽,以便获得更佳的性能。

解决方式:
// 错误
return h(xxx, , );
// 正确
return h(xxx, , { default: () => xxx });
// 多个插槽
return h( xxx,
, { default: () => [xxx, xxx], });

vue 动态加载路由

next({ path: to.path });
// hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
next({ ...to, replace: true });

encodeURIComponentencodeURI 区别:encodeURIComponent加密URI参数;encodeURI加密URI

1.安装插件:@babel/plugin-proposal-optional-chaining 和 @babel/plugin-proposal-nullish-coalescing-operator

可选链?.

npm install @babel/plugin-proposal-optional-chaining --save

yarn add @babel/plugin-proposal-optional-chaining

空值合并 ??

npm install @babel/plugin-proposal-nullish-coalescing-operator --save

yarn add @babel/plugin-proposal-nullish-coalescing-operator

  1. 在.babelrc 或babel.config.js中 的 plugins中添加 @babel/plugin-proposal-optional-chaining

module.exports = {
  plugins: [
    '@babel/plugin-proposal-optional-chaining', // 可选链 ?.    
    '@babel/plugin-proposal-nullish-coalescing-operator' // 空值合并 ??
  ]
}

微信小程序map组件使用的经纬度是火星坐标系,调用 wx.getLocation 接口需要指定 type 为 gcj02

Ant Design Charts 解决页面scale可在config中添加supportCSSTransform: true 参数

{
    supportCSSTransform: true
}

MySQL GROUP_CONCAT()查询结果截断解决方案 。

  1. 修改配置文件

# group_count最大长度
group_concat_max_len = 1024000
  1. 执行sql语句
    SET SESSION group_concat_max_len = 10240;