3

私は次のものを持っています:

(function ($) {
    /**
    * Opens a new modal window
    * @param object options an object with any of the following options
    * @return object the jQuery object of the new window
    */
    $.modal = function (options) {
        var settings = $.extend({}, $.modal.defaults, options),
            root = getModalDiv(),

私のコードには次のようなものがあります。

///<reference path='jquery.d.ts' />
function alertWin(title, message) {
    $.modal({

次のようなエラーがあります。

プロパティモーダルは、タイプ'JQueryStatic'の値には存在しません

この問題を解決するには、ある種のテンプレートファイルを作成する必要がありますか?作成する場合、どうすればよいですか?

4

1 に答える 1

4

JQueryStaticのインターフェースを拡張するだけで、どのファイルでも実行でき、typescriptはそれらをマージします

interface JQueryStatic {
  modal( options );
}
于 2012-10-26T07:39:36.630 に答える