diff --git a/pages/process/index/index.json b/pages/process/index/index.json index 56190af..fb84d4e 100644 --- a/pages/process/index/index.json +++ b/pages/process/index/index.json @@ -6,7 +6,6 @@ "van-grid-item": "/components/grid-item/index", "van-cell": "/components/cell/index", "van-icon": "/components/icon/index", - "van-popup": "/components/popup/index", "van-action-sheet": "/components/action-sheet/index", "van-calendar": "/components/calendar/index" } diff --git a/workers/process.js b/workers/process.js new file mode 100644 index 0000000..c47cc2f --- /dev/null +++ b/workers/process.js @@ -0,0 +1,13 @@ +// worker的优化计算 +worker.onMessage(function(res){ + console.log('这是worker内部线程打印的') + console.log(res) + let sum = add(res.x,res.y); + worker.postMessage({ + sum : sum + }) +}); + +function add(x, y){ + return x + y; +} \ No newline at end of file