mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 16:11:20 -08:00
update stateMix
This commit is contained in:
1 parent
6743144f44
commit
609ccb4c46
11 files changed
+71
-70
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { def } from '../utils';
|
||||
|
||||
export default function stateMix(art) {
|
||||
const states = ['mini', 'pip', 'fullscreen', 'fullscreenWeb'];
|
||||
def(art, 'state', {
|
||||
get: () => states.find((name) => art[name]) || '',
|
||||
set(name) {
|
||||
for (let index = 0; index < states.length; index++) {
|
||||
const prop = states[index];
|
||||
if (prop !== name) {
|
||||
art[prop] = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user