File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -138,22 +138,24 @@ You can also specify custom controls as objects in the [`toolbar`](api/config/to
138138
139139You can specify custom buttons within a [ toolbar] ( api/config/toolbar.md ) as follows:
140140
141- ~~~ jsx {6-14 }
141+ ~~~ jsx {6-16 }
142142new richtext.Richtext (" #root" , {
143143 toolbar: [
144144 " bold" ,
145145 " italic" ,
146146 " separator" ,
147147 {
148148 type: " button" ,
149- id: " btn1" ,
150- icon: " wxo-help" ,
151- css: " rounded" ,
152- label: " Custom button" ,
153- tooltip: " Some tooltip" ,
154- handler : () => { /* some action here */ }
149+ id: " custom" ,
150+ css: " wx-primary" ,
151+ label: " Count characters" ,
152+ handler : () => {
153+ const text = widget .getValue (richtext .text .toText );
154+ const charCount = text .replace (/ \s / g , " " ).length ;
155+ document .getElementById (" count" ).innerText = charCount;
156+ }
155157 },
156- // other custom buttons
158+ // other custom controles
157159 ],
158160 // other configuration properties
159161});
Original file line number Diff line number Diff line change @@ -100,28 +100,28 @@ A full list of new events is available [here](/category/richtext-events/)
100100## Deprecated API
101101
102102::: warning
103- Do not use the deprecated API in your projects!
103+ Do not use the deprecated API in your projects! < br /> Refer to the [ Migration ] ( news/migration.md ) topic for more information.
104104:::
105105
106- ### ❌ Deprecated properties
106+ ### [ Deprecated properties] ( news/migration.md#properties-migration )
107107
108- - ` customStats `
109- - ` mode `
110- - ` toolbarBlocks `
108+ - [ ` customStats ` ] ( news/migration.md#--customstats )
109+ - [ ` mode ` ] ( news/migration.md#--mode--layoutmode )
110+ - [ ` toolbarBlocks ` ] ( news/migration.md#--toolbarblocks--toolbar )
111111
112- ### ❌ Deprecated methods
112+ ### [ Deprecated methods] ( news/migration.md#methods-migration )
113113
114114- ` exitFullScreen() `
115115- ` fullScreen() `
116116- ` getEditorAPI() `
117117- ` getStats() `
118118- ` paint() `
119119
120- ### ❌ Deprecated internal methods
120+ ### Deprecated internal methods
121121
122- - ` events.fire() `
122+ - [ ` events.fire() ` ] ( news/migration.md#--fire--use-exec-and-intercept )
123123
124- ### ❌ Deprecated events
124+ ### Deprecated events
125125
126126- ` Action `
127127- ` Change `
You can’t perform that action at this time.
0 commit comments