Library: Document that, when using requirejs, a page should only be instantiated after the whole library is loaded, otherwise it may fail to instantiate some widgets

Đang mở
#339 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@gabrielschulhof đang làm issue này rồi.

Từ ngày 14/10/2014.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

We need to provide an example of a scenario where somebody uses the library using requirejs, and maybe skips init altogether. For example,

require([
    "jqm/widgets/popup",
    "jqm/widgets/listview",
    "jqm/widgets/page" ], function() {

    $( function() {
        $( "#start-page" ).page();
    });
};

Will not work if requirejs loads page after it has loaded popup and listview. We need to document that, in 1.4.x, one needs to require page before requiring any of the widgets:

require([
    "jqm/widgets/page" ], function() {

    require([
        "jqm/widgets/popup",
        "jqm/widgets/listview" ] ,function() {

        $( function() {
            $( "#start-page" ).page();
        });
    });
});
Ngôn ngữ chính
HTML
Star
55
Fork
57
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của jquery/api.jquerymobile.com

Tất cả issue của jquery/api.jquerymobile.com

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.