我有这段代码可以在单击按钮时显示列表。如何在不单击按钮的情况下显示列表?
<button class="btn" type="submit" data-bind="click: getList">Get List</button>
<ul data-bind="foreach: pList">
<li>
<b data-bind="text: $data"></b>
</li>
</ul>
define(['sublime/aadConfig','knockout'], function (aconfig,ko) {
var plugins = ko.observableArray([]);
var getPlugins = function () {
plugins(aconfig.getPluginList());
};
return {
pList: plugins,
getList: getPlugins
};
});