JingFeng Chen

Results 15 comments of JingFeng Chen

```js function renum(num) { num = num.toString() let rest = num.slice(0, -1), last = num.slice(-1); return last.length ? last + renum(rest) : '' } console.log(renum(12345678)); // 87654321 ```

```js Array.prototype.flat= function() { return [].concat(...this.map(item => (Array.isArray(item) ? item.flat() : [item]))); } Array.prototype.unique = function() { return [...new Set(this)] } const sort = (a, b) => a - b;...

> > ```js > > Array.prototype.falt = function() { > > return [].concat(...this.map(item => (Array.isArray(item) ? item.falt() : [item]))); > > } > > > > Array.prototype.unique = function() {...

> 一个是监听里触发,一个是在监听里面监听,后者不会死循环,emit的时候相当于创建了一个原事件队列的复制去执行,再监听会加入队列,但之前的队列已经被复制好了.可以看看[这里](https://github.com/GaleLQ/notes/blob/master/nodejs/events%E6%BA%90%E7%A0%81%E8%AE%BE%E8%AE%A1%E6%80%9D%E6%83%B3.js#L40) 就是在 emit 执行的时候,会把之前注册好的回调列表复制副本取出执行,但是在 cb 里面继续在添加监听回调的话,会在原有的 listeners 里面继续添加,但是不会执行;因为执行的 callback list 和推入的 callbacklist 实际上内存中的引用不是同一个了. ![image](https://user-images.githubusercontent.com/20502762/126421994-d0ccb8c6-2a7c-4af1-92ff-a5d662ab77a4.png)

i think you quesition is how to deploy nuxt project in prod ?

你好,我们已经提炼出了 nuxt 作为主应用的 DEMO @abiaoGit @wendy-banzhuanke @Jenniferyingni 放个直达[链接](https://github.com/cjfff/nuxt-qiankun-project) 一些细节介绍也可以查看这个未写完的[分享文档](https://www.yuque.com/ubdme4/ccc/gm9lz6) 有什么问题可以留言继续交流!

最近更新,文章已经整理发布到知乎啦,可以直接[访问](https://zhuanlan.zhihu.com/p/186278992) 另外 demo 都在本仓库的 examples 下了,希望对大家有帮助吧~

这里子应用你添加完整的 public_path 路径试试,不然的话,浏览器会默认加上现在访问应用的域名的

emmm, because you use the push in main app, the main app don't know the subapp path. you can image the qiankun in main_app is use you subapp_path to redirect...