tencent cloud

Feedback

rich text

Last updated: 2024-03-05 15:07:22

    EditorContext

    Feature Description: An EditorContext instance can be obtained through wx.createSelectorQuery. The EditorContext is bound to an editor component through an id, thereby manipulating the corresponding editor component.

    .blur

    This method is used via EditorContext.blur().
    Feature Description: The editor loses focus, concurrently retracting the keyboard.
    Parameter and Description: Object
    Attribute
    Type
    Default value
    Required
    Description
    success
    function
    -
    No
    Callback Function of Successful Interface Call
    fail
    function
    -
    No
    Callback Function of Failing Interface Call
    complete
    function
    -
    No
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)

    .clear

    This method is used via EditorContext.clear().
    Feature Description: Empties the content of the editor.
    Parameter and Description: Object.
    Attribute
    Type
    Default value
    Required
    Description
    success
    function
    -
    No
    Callback Function of Successful Interface Call
    fail
    function
    -
    No
    Callback Function of Failing Interface Call
    complete
    function
    -
    No
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)

    .format

    This method is used via EditorContext.format(string name, string value).
    Feature Description: Modifies the style.
    Parameter and Description: Object.

    .getContents

    This method is used via EditorContext.getContents().
    Feature Description: Gets the content of the editor.
    Parameter and Description: Object.

    .getSelectionText

    This method is used via EditorContext.getSelectionText(Object object).
    Feature Description: Gets the plain text content within the selected area of the editor. When the editor loses focus or a section is not selected, the returned content is empty.
    Parameter and Description: Object.

    .insertDivider

    This method is used via EditorContext.insertDivider().
    Feature Description: Inserts a divider.
    Parameter and Description: Object.
    Attribute
    Type
    Default value
    Required
    Description
    success
    function
    -
    No
    Callback Function of Successful Interface Call
    fail
    function
    -
    No
    Callback Function of Failing Interface Call
    complete
    function
    -
    No
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)

    .insertlmage

    This method is used via EditorContext.insertlmage(Object object).
    Feature Description: Inserts an image.
    When the address is a temporary file, the HTML format content of the editor obtained adds the attribute data-local to the tag, and the data-local field is added to the image attributes attribute in the data format content, which is the address of the temporary file passed in.
    Developers can opt to upload images to the server during the submission phase, replacing them once the network address is obtained. For HTML content, the src value should be replaced, while for delta content, the insert {image: abc} value should be substituted.
    Parameter and Description: Object.

    .insertText

    This method is used via EditorContext.insertText(Object object).
    Feature Description: Overwrites the current selected area, setting a segment of text.
    Parameter and Description: Object.
    Attribute
    Type
    Default value
    Required
    Description
    text
    string
    -
    No
    Text Content
    success
    function
    -
    No
    Callback Function of Successful Interface Call
    fail
    function
    -
    No
    Callback Function of Failing Interface Call
    complete
    function
    -
    No
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)

    .redo

    This method is used via EditorContext.redo(Object object).
    Feature Description: Restoration.
    Parameter and Description: Object.
    Attribute
    Type
    Default value
    Required
    Description
    success
    function
    -
    No
    Callback Function of Successful Interface Call
    fail
    function
    -
    No
    Callback Function of Failing Interface Call
    complete
    function
    -
    No
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)

    .removeFormat

    This method is used via EditorContext.removeFormat(Object object).
    Feature Description: Clears the style of the current selected area.
    Parameter and Description: Object.
    Attribute
    Type
    Default value
    Required
    Description
    success
    function
    -
    No
    Callback Function of Successful Interface Call
    fail
    function
    -
    No
    Callback Function of Failing Interface Call
    complete
    function
    -
    No
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)

    .scrolllntoView

    This method is used via EditorContext.scrollIntoView().
    Feature Description: Enables the editor cursor to scroll within the visible area of the window.

    .setContents

    This method is used via EditorContext.setContents(Object object).
    Feature Description: Initializes the editor content. When both html and delta exist, only delta takes effect.
    Parameter and Description: Object.

    .undo

    This method is used via EditorContext.undo().
    Feature Description: Undo.
    Parameter and Description: Object.
    Attribute
    Type
    Default value
    Required
    Description
    success
    function
    -
    No
    Callback Function of Successful Interface Call
    fail
    function
    -
    No
    Callback Function of Failing Interface Call
    complete
    function
    -
    No
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support