<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                [TOC] ## getBounds <!-- Retrieves the pixel position (relative to the editor container) and dimensions of a selection at a given location. The user's current selection need not be at that index. Useful for calculating where to place tooltips. --> 返回給定選區相對于編輯器容器的的像素位置和尺寸。用戶的當前選區不需要在索引下。用于計算提示框的位置。 **方法** ```javascript getBounds(index: Number, length: Number = 0): { left: Number, top: Number, height: Number, width: Number } ``` **示例** ```javascript quill.setText('Hello\nWorld\n'); quill.getBounds(7); // Returns { height: 15, width: 0, left: 27, top: 31 } ``` ## getSelection <!-- Retrieves the user's selection range, optionally to focus the editor first. Otherwise `null` may be returned if editor does not have focus. --> 計算用戶選擇的范圍,可選是否要求焦點在編輯器上(如果focus為true,且焦點會一直在編輯器內,且不改變選區)。如果焦點不在編輯器上,將會返回null。 **方法** ```javascript getSelection(focus = false): { index: Number, length: Number } ``` **示例** ```javascript var range = quill.getSelection(); if (range) { if (range.length == 0) { console.log('User cursor is at index', range.index); } else { var text = quill.getText(range.index, range.length); console.log('User has highlighted: ', text); } } else { console.log('User cursor is not in editor'); } ``` ## setSelection <!-- Sets user selection to given range, which will also focus the editor. Providing `null` as the selection range will blur the editor. [Source](/docs/api/#events) may be `"user"`, `"api"`, or `"silent"`. --> 給定范圍設置用戶的選區,同時焦點在編輯器上。作為選區傳入 `null`,將會使編輯器失去焦點。[Source](事件events.md) 可能是 `"user"`, `"api"`,或者 `"silent"`. **方法** ```javascript setSelection(index: Number, length: Number, source: String = 'api') setSelection(range: { index: Number, length: Number }, souce: String = 'api') ``` **示例** ```javascript quill.setSelection(0, 5); ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看