如何使用安装包?

时间:2018-06-01 10:38:42

标签: sapui5

我想在我通过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));
        }

但它不起作用。我做错了什么?

0 个答案:

没有答案