Problem description
When using wangeditor, input content, and press enter to switch to the next line, the cursor cuts over and automatically jumps back.
Cause of the problem
After encapsulating a component, the onchange event of wangeditor will be triggered every time the content passed in from the parent is used. In the onchange event, the modified value is assigned to the parent component by passing the child to the parent. After the value of the parent component changes, the value of the child component wangeditor will also be modified. Therefore, the cursor always jumps to the last. At this point, there is another problem of concurrency, that is, it is invalid after the undo and resume click.
Solution
When the child component watch listens to the value passed in by the parent component, it adds judgment to ensure that the input content is zero and the assignment will not be triggered
Instead of using the official recommended catchdata, the child component uses the method of passing the value to the parent component (that is, $emit) to synchronize the value to the parent component, so as to ensure that the value of the parent component is consistent with the content of the rich text when saving
if it can help you, please use your little hand to like it
thank you.
Read More:
- Linux command line cursor moving skills
- Android EditText cursor control, color modification, show and hide
- Cursor window allocation of 2048 kb failed
- Ubutnu’s idea input method candidate box can’t follow the cursor
- Android studio displays the class and method where the cursor is located
- TypeError: object of type ‘Cursor‘ has no len()
- Unity Cursor Lock& Camera Lock
- Error syncing pod, skipping: failed to “StartContainer” for “POD” with Image
- When IntelliJ idea is programmed, 1. Black thick line or black cursor appears; 2. The solution of carriage return unable to wrap. (practical recommendation method 2)
- Solve the problem of using in tensoft 2. X tf.contrib.slim No module named appears in the package: tensorflow.contrib problem
- NPM warn optional skipping optional dependency: 1 [email protected] (node_ modules\fsevents):
- Duplicate class com.xxx.xxx Find in modules problem solving (Aidl interdependence problem)
- To solve the problem of failed to load: data in HTML5 game running rmmv locally/ actors.json problem
- Solve the problem of Python in Windows environment: Fatal error in launcher: Unable to create process using’”‘ in pip installation
- Solve the problem that the value in the disabled tag cannot be passed to the server
- In many cases, the problem of error reporting by label in latex
- Solution to the problem of Chinese garbled in gradle console in idea
- The use of Chinese characters in Qt and the solution to the “error C2001: newline in constant” problem
- The problem of “value error: zero length field name in format” in Python 2.6.6 of CentOS 6.9
- Solve the problem of failure in installation of golang plug-in dependency in vscode