update stateMix

This commit is contained in:
Harvey Zack committed 2023-04-20 11:49:43 +08:00
1 parent 6743144f44
commit 609ccb4c46
11 files changed
+71 -70

No files matched your search

+16
View File
@@ -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;
}
}
},
});
}