我想在我通过lodash
安装的控制器中使用npm
lib。
{
"name": "APP",
"version": "0.0.1",
"description": "",
"private": true,
"dependencies": {
"lodash": "^4.17.10"
},
"devDependencies": {
"@sap/grunt-sapui5-bestpractice-build": "1.3.55"
}
}
我尝试过如下:
sap.ui.define([
"sap/ui/core/mvc/Controller", "lodash"
], function(Controller, _) {
"use strict";
return Controller.extend("ch.mindustry.ZSD_QUICK_SALES.controller.Selection", {
onInit: function() {
console.log(_.partition([1, 2, 3, 4], n => n % 2));
}
但它不起作用。我做错了什么?