Skip to content

Commit

Permalink
⚡improve error tip
Browse files Browse the repository at this point in the history
  • Loading branch information
宋慧武 committed Apr 17, 2019
1 parent e572e4c commit 9c7faa2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/hooks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: 宋慧武
* @Date: 2019-03-06 17:49:29
* @Last Modified by: 宋慧武
* @Last Modified time: 2019-04-16 22:40:22
* @Last Modified time: 2019-04-17 12:29:17
*/
import {
zipArray,
Expand Down Expand Up @@ -181,7 +181,7 @@ export function bind(
el[`$on_${eventName}`] = true; // 避免重复监听
});
} else {
debug.tip(rawName);
throw new Error(`不支持${rawName}指令`);
}
}

Expand Down
8 changes: 1 addition & 7 deletions src/utils/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: 宋慧武
* @Date: 2019-04-14 15:55:15
* @Last Modified by: 宋慧武
* @Last Modified time: 2019-04-14 16:08:25
* @Last Modified time: 2019-04-17 12:28:30
*/
import { isProd, isFun } from "./helper";

Expand All @@ -11,9 +11,3 @@ export const checkFun = fn => {
throw new Error("第一个参数应该为 Function~");
}
};

export const tip = dir => {
if (!isProd) {
throw new Error(`${dir}指令暂不支持`);
}
};

0 comments on commit 9c7faa2

Please sign in to comment.