wip
This commit is contained in:
parent
b89bf97c9a
commit
404583a285
|
@ -45,7 +45,13 @@ export function api(endpoint: string, data: Record<string, any> = {}, token?: st
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function popup(component: Component, props: Record<string, any>, events = {}, option?) {
|
function isModule(x: any): x is typeof import('*.vue') {
|
||||||
|
return x.default != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function popup(component: Component | typeof import('*.vue'), props: Record<string, any>, events = {}, option?) {
|
||||||
|
if (isModule(component)) component = component.default;
|
||||||
|
|
||||||
if (_DEV_) {
|
if (_DEV_) {
|
||||||
console.log('os:popup', component, props, events);
|
console.log('os:popup', component, props, events);
|
||||||
}
|
}
|
||||||
|
@ -75,7 +81,9 @@ export function popup(component: Component, props: Record<string, any>, events =
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function modal(component: Component, props: Record<string, any>, events = {}, option?: { source?: any; position?: any; cancelableByBgClick?: boolean; }) {
|
export function modal(component: Component | typeof import('*.vue'), props: Record<string, any>, events = {}, option?: { source?: any; position?: any; cancelableByBgClick?: boolean; }) {
|
||||||
|
if (isModule(component)) component = component.default;
|
||||||
|
|
||||||
if (_DEV_) {
|
if (_DEV_) {
|
||||||
console.log('os:modal', component, props, events, option);
|
console.log('os:modal', component, props, events, option);
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@ export default defineComponent({
|
||||||
|
|
||||||
async configure() {
|
async configure() {
|
||||||
const includingTypes = notificationTypes.filter(x => !this.$store.state.i.mutingNotificationTypes.includes(x));
|
const includingTypes = notificationTypes.filter(x => !this.$store.state.i.mutingNotificationTypes.includes(x));
|
||||||
os.modal(await import('@/components/notification-setting-window.vue').then(x => x.default), {
|
os.modal(await import('@/components/notification-setting-window.vue'), {
|
||||||
includingTypes,
|
includingTypes,
|
||||||
showGlobalToggle: false,
|
showGlobalToggle: false,
|
||||||
}).then(async (res) => {
|
}).then(async (res) => {
|
||||||
|
|
|
@ -146,7 +146,7 @@ export class Autocomplete {
|
||||||
|
|
||||||
this.opening = false;
|
this.opening = false;
|
||||||
} else {
|
} else {
|
||||||
const MkAutocomplete = await import('@/components/autocomplete.vue').then(x => x.default);
|
const MkAutocomplete = await import('@/components/autocomplete.vue');
|
||||||
|
|
||||||
const _x = ref(x);
|
const _x = ref(x);
|
||||||
const _y = ref(y);
|
const _y = ref(y);
|
||||||
|
|
|
@ -38,6 +38,7 @@ const widget = define({
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
extends: widget,
|
extends: widget,
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
MkContainer,
|
MkContainer,
|
||||||
XNotifications,
|
XNotifications,
|
||||||
|
@ -51,7 +52,7 @@ export default defineComponent({
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
async configure() {
|
async configure() {
|
||||||
os.modal(await import('@/components/notification-setting-window.vue').then(x => x.default), {
|
os.modal(await import('@/components/notification-setting-window.vue'), {
|
||||||
includingTypes: this.props.includingTypes,
|
includingTypes: this.props.includingTypes,
|
||||||
}).then(async ({ includingTypes }) => {
|
}).then(async ({ includingTypes }) => {
|
||||||
this.props.includingTypes = includingTypes;
|
this.props.includingTypes = includingTypes;
|
||||||
|
|
Loading…
Reference in New Issue