misleading example on access of widget instance through .data()
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, jquery
調査の方向性
リンク先の jQuery Learning Center のページを開き、「The Widget Factory Under the Hood」セクション、特に .progressbar() と .data("nmk-progressbar") の例を確認してください。jQuery UI progressbar インスタンスと nmk-progressbar プラグインを正確に区別できるよう、例またはその説明を更新し、その後、レンダリングされたドキュメントが明確であることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
When a plugin instance is created, it is stored on the original DOM element using jQuery.data, with the plugin's full name (the plugin's namespace, plus a hyphen, plus the plugin's name) as the key.
var bar = $( "<div />")
.appendTo( "body" )
.progressbar()
.data( "nmk-progressbar" );
// Call a method directly on the plugin instance.
bar.option( "value", 50 );
// Access properties on the plugin instance.
alert( bar.options.value );
I think the example given is misleading even with the namespace specified in accessing jQuery.data,
i.e. .data("nmk-progressbar").
The issue is that .progressbar() actually creates an instance of the Progressbar Widget of jQuery UI https://api.jqueryui.com/progressbar/#quick-nav rather than one of the plugin nmk-progressbar
built with Widget Factory.
The code snippet happens to make it being able to access the plugin instance of nmk-progressbar
by using the key "nmk-progressbar", which does run successfully but incorrect in meaning.
As considering the context in the article is with jQuery UI Widget Factory, this suggests audiences
that it is a way, using .progressbar(), to make an instance of the plugin nmk-progressbar.
I hope I am not wrong and expect for comments from anyone experienced.
Thanks ^_^
- 主要言語
- JavaScript
- スター
- 914
- フォーク
- 472
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
jquery/learn.jquery.com のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
jquery/learn.jquery.com#828 ·
-
Word(s) missing in article?再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンChapter: events
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
jquery/learn.jquery.com#751 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
jquery/learn.jquery.com#814 · コメント 1 件 ·
-
Chapter: jquery-core help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
jquery/learn.jquery.com#799 ·
-
Chapter: plugins
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
jquery/learn.jquery.com#782 ·
jquery/learn.jquery.com の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
good first issue help wanted javascript up-for-grabs
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
andrewsiah/agentswarm-data-tasks#307 ·
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
coder/claudecode.nvim#588 ·
メンテナーはふだん 1 日以内に返信
-
area: web tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
digitalbazaar/http-client#60 ·