parent
678dba9245
commit
a637b4e282
56 changed files with 4701 additions and 108 deletions
|
@ -18,6 +18,9 @@ export default defineComponent({
|
|||
watch(value, () => {
|
||||
context.emit('update:modelValue', value.value);
|
||||
});
|
||||
watch(() => props.modelValue, v => {
|
||||
value.value = v;
|
||||
});
|
||||
if (!context.slots.default) return null;
|
||||
let options = context.slots.default();
|
||||
const label = context.slots.label && context.slots.label();
|
||||
|
|
|
@ -52,7 +52,7 @@ const props = defineProps<{
|
|||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(ev: 'change', _ev: KeyboardEvent): void;
|
||||
(ev: 'changeByUser'): void;
|
||||
(ev: 'update:modelValue', value: string | null): void;
|
||||
}>();
|
||||
|
||||
|
@ -77,7 +77,6 @@ const height =
|
|||
const focus = () => inputEl.value.focus();
|
||||
const onInput = (ev) => {
|
||||
changed.value = true;
|
||||
emit('change', ev);
|
||||
};
|
||||
|
||||
const updated = () => {
|
||||
|
@ -136,6 +135,7 @@ function show(ev: MouseEvent) {
|
|||
active: computed(() => v.value === option.props.value),
|
||||
action: () => {
|
||||
v.value = option.props.value;
|
||||
emit('changeByUser', v.value);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
|
@ -85,7 +85,7 @@ const recentUsers = ref<Misskey.entities.UserDetailed[]>([]);
|
|||
const selected = ref<Misskey.entities.UserDetailed | null>(null);
|
||||
const dialogEl = ref();
|
||||
|
||||
const search = () => {
|
||||
function search() {
|
||||
if (username.value === '' && host.value === '') {
|
||||
users.value = [];
|
||||
return;
|
||||
|
@ -98,9 +98,9 @@ const search = () => {
|
|||
}).then(_users => {
|
||||
users.value = _users;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
const ok = () => {
|
||||
function ok() {
|
||||
if (selected.value == null) return;
|
||||
emit('ok', selected.value);
|
||||
dialogEl.value.close();
|
||||
|
@ -110,12 +110,12 @@ const ok = () => {
|
|||
recents = recents.filter(x => x !== selected.value.id);
|
||||
recents.unshift(selected.value.id);
|
||||
defaultStore.set('recentlyUsedUsers', recents.splice(0, 16));
|
||||
};
|
||||
}
|
||||
|
||||
const cancel = () => {
|
||||
function cancel() {
|
||||
emit('cancel');
|
||||
dialogEl.value.close();
|
||||
};
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
misskeyApi('users/show', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue