3
我想將一些配置信息傳遞給我的aurelia功能,但我不知道如何。我沒有找到關於aurelia文檔如何做的文檔。Aurelia將配置傳遞給插件或功能
我的特點
Main.js
.feature('aurelia-scrollbar', config => {
// I want to pass an object along this
config.foo = { bar: 'yay' }
})
Index.js
export function configure(config) {
config.globalResources('./scrollbar');
}
Scrollbar.js
import Scrollbar from 'smooth-scrollbar';
import 'smooth-scrollbar/dist/smooth-scrollbar.css!';
export class ScrollbarCustomAttribute {
static inject = [Element];
constructor(element) {
this.element = element;
}
attached() {
Scrollbar.init(this.element); // I want to use the passed configuration option here
}
}