LegacyPluginThis

LegacyImporterLegacyFunction 回呼的上下文中,`this` 的值。(The value of `this` in the context of a LegacyImporter or LegacyFunction callback.)

已棄用(Deprecated)

這僅由舊版 renderrenderSync API 使用。請改用 compilecompileStringcompileAsynccompileStringAsync。(This is only used by the legacy render and renderSync APIs. Use compile, compileString, compileAsync, and compileStringAsync instead.)

階層(Hierarchy)

屬性(Properties)

屬性(Properties)

options: {
    context: LegacyPluginThis;
    data?: string;
    file?: string;
    includePaths: string;
    indentType: 0 | 1;
    indentWidth: number;
    linefeed: "\r" | "\r\n" | "\n" | "\n\r";
    precision: 10;
    result: {
        stats: {
            entry: string;
            start: number;
        };
    };
    style: 1;
}

傳遞給 renderrenderSync 之選項的部分表示。

類型宣告

  • context: LegacyPluginThis

    包含此物件的相同 LegacyPluginThis 實例。

  • 選用 data?: string

    傳遞給 data 的值。

  • 選用 file?: string

    傳遞給 filefile 的值。

  • includePaths: string

    傳遞給 includePaths 的值,在 Windows 上以 `";"` 分隔,在其他作業系統上以 `":"` 分隔。這總是包含目前工作目錄作為第一個項目。

  • indentType: 0 | 1

    如果 indentType 為 `“tab”`,則為 1,否則為 0。

  • indentWidth: number

    傳遞給 indentWidth 的值,否則為 `2`。

  • linefeed: "\r" | "\r\n" | "\n" | "\n\r"

    傳遞給 linefeed 的值,否則為 "\n"

  • precision: 10

    永遠是數字 10。

  • result: {
        stats: {
            entry: string;
            start: number;
        };
    }

    一個部分建構的 LegacyResult 物件。

    • stats: {
          entry: string;
          start: number;
      }

      關於編譯進度的部分資訊。

      • entry: string

        如果傳遞了 file,則為其值,否則為字串 "data"

      • start: number

        1970 年 1 月 1 日 00:00:00 UTC 與 Sass 編譯開始時間之間的毫秒數。

  • style: 1

    永遠是數字 1。