mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 08:01:20 -08:00
限制参数范围
This commit is contained in:
1 parent
748ce304e6
commit
5f384fb04d
7 files changed
+59
-41
No files matched your search
@@ -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);
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user