Commit a9bd31b0 by jml0128

fix

1 parent 64090a75
{ {
"name": "xrk-bi", "name": "xrk-bi",
"version": "0.1.5", "version": "0.1.6",
"description": "xrk-bi", "description": "xrk-bi",
"author": "xrk", "author": "xrk",
"main": "dist/bundler.js", "main": "dist/bundler.js",
......
...@@ -205,9 +205,9 @@ export const keepLastIndex = (obj, focusOffset) => { ...@@ -205,9 +205,9 @@ export const keepLastIndex = (obj, focusOffset) => {
export const initDivInput = ( export const initDivInput = (
dom, dom,
options = { useWrap: false, usePasteStyle: false } options = { useWrap: false, usePasteStyle: false, callback: () => {} }
) => { ) => {
const { useWrap, usePasteStyle } = options; const { useWrap, usePasteStyle, callback } = options;
const maxlength = dom.getAttribute('maxlength'); const maxlength = dom.getAttribute('maxlength');
let baseIndex = 0; let baseIndex = 0;
let focusIndex = 0; let focusIndex = 0;
...@@ -304,4 +304,7 @@ export const initDivInput = ( ...@@ -304,4 +304,7 @@ export const initDivInput = (
} else { } else {
console.warn('启用usePasteStyle,在粘贴时候无法限制字符长度'); console.warn('启用usePasteStyle,在粘贴时候无法限制字符长度');
} }
dom.addEventListener('blur', function() {
callback(this.innerText);
});
}; };
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!