未验证 提交 6af89231 编写于 作者: Y Yi Shen 提交者: GitHub

Merge pull request #13139 from easonyq/fix-13031

Fix: make `contentToOption` totally optional
......@@ -371,6 +371,15 @@ class DataView extends ToolboxFeature<ToolboxDataViewFeatureOption> {
addEventListener(closeButton, 'click', close);
addEventListener(refreshButton, 'click', function () {
if ((contentToOption == null && optionToContent != null) ||
(contentToOption != null && optionToContent == null)) {
if (__DEV__) {
console.warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.')
}
close();
return;
}
let newOption;
try {
if (typeof contentToOption === 'function') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册