限制参数范围

This commit is contained in:
Harvey Zack committed 2018-11-23 10:30:54 +08:00
1 parent 748ce304e6
commit 5f384fb04d
7 files changed
+59 -41

No files matched your search

+1 -4
View File
@@ -8,10 +8,7 @@ export default function flipMix(art, player) {
Object.defineProperty(player, 'flip', {
value: flip => {
const flipList = ['normal', 'horizontal', 'vertical'];
errorHandle(
flipList.includes(flip),
`The 'angle' need to be one of '[normal, horizontal, vertical]', but got ${flip}`,
);
errorHandle(flipList.includes(flip), `'flip' only accept ${flipList.toString()} as parameters`);
art.refs.$player.dataset.flip = flip;
art.emit('flipChange', flip);
},