mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-10 21:06:15 -08:00
22 lines
575 B
JavaScript
22 lines
575 B
JavaScript
import { append, tooltip } from '../utils';
|
|
|
|
export default function setting(option) {
|
|
return (art) => ({
|
|
...option,
|
|
tooltip: art.i18n.get('Show Setting'),
|
|
mounted: ($control) => {
|
|
const { proxy, icons, i18n } = art;
|
|
|
|
append($control, icons.setting);
|
|
|
|
proxy($control, 'click', () => {
|
|
art.setting.toggle = true;
|
|
});
|
|
|
|
art.on('setting', (value) => {
|
|
tooltip($control, i18n.get(value ? 'Hide Setting' : 'Show Setting'));
|
|
});
|
|
},
|
|
});
|
|
}
|