我在回送v3应用程序中定义了一个mixin,但出现此错误:
Model "Question" uses unknown mixin: Time
model-config.json:
"mixins": [
"loopback/common/mixins",
"loopback/server/mixins",
"../common/mixins",
"./mixins"
]
question.json:
"mixins": {
"Time": {
"arg":"text"
}
}
我的mixin文件名:
Time.js (in ./common/mixins folder)
Time.js代码:
'use strict';
module.exports = function (Model, options) {
console.log("OK");
};
答案 0 :(得分:0)
好。通过将mixin文件名更改为time.js(小写),将question.json中的mixin名称更改为“ Time”(大写),即可正常工作。