我在Aurelia.js和semantic-ui結合使用。這兩個框架都能夠填充html的「select」元素。 (繼2 「官方的例子」。)aurelia數據綁定/ gui元素初始化的最佳(默認)方法
的語義的方式將例如是:
(<any>$('#semanticSelect'))
.dropdown({
apiSettings: {
url: '//api.semantic-ui.com/tags/{query}'
}
})
;
奧裏利亞的方式根據樣品將與HttpClient的
users = [];
constructor(private http: HttpClient) {
http.configure(config => {
config
.useStandardConfiguration()
.withBaseUrl('https://api.github.com/');
});
}
activate() {
return this.http.fetch('users')
.then(response => response.json())
.then(users => this.users = users);
}
,並與
repeat.for="user of users"
HTML和綁定根據像
<div class="item" repeat.for="user of users" data-value.bind="user.id">${user.login}</div>
所以我現在有點困惑什麼是一起工作的正確方法的需求呢?任何人都可以解釋我有什麼不同,推薦的方式是什麼? 這是GUI控件應如何初始化的主要問題 - >通過aurelia framwork方法或語義ui框架!我正在考慮性能,緩存和安全。我無處閱讀它是如何被推薦的。
謝謝!
可能重複的[Aurelia語義下拉](http://stackoverflow.com/questions/31731478/aurelia-semantic-dropdown) –
我寫了一個關於創建自定義元素包裝CSS框架的博客:http:///davismj.me/blog/semantic-custom-element/ –