mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-03 00:56:00 +02:00
enhance(frontend): typed nirax (#16309)
* enhance(frontend): typed nirax * migrate router.replace * fix
This commit is contained in:
@@ -495,7 +495,7 @@ function done(query?: string): boolean | void {
|
||||
|
||||
function settings() {
|
||||
emit('esc');
|
||||
router.push('settings/emoji-palette');
|
||||
router.push('/settings/emoji-palette');
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -151,7 +151,7 @@ const contextmenu = computed(() => ([{
|
||||
|
||||
function back() {
|
||||
history.value.pop();
|
||||
windowRouter.replace(history.value.at(-1)!.path);
|
||||
windowRouter.replaceByPath(history.value.at(-1)!.path);
|
||||
}
|
||||
|
||||
function reload() {
|
||||
@@ -163,7 +163,7 @@ function close() {
|
||||
}
|
||||
|
||||
function expand() {
|
||||
mainRouter.push(windowRouter.getCurrentFullPath(), 'forcePage');
|
||||
mainRouter.pushByPath(windowRouter.getCurrentFullPath(), 'forcePage');
|
||||
windowEl.value?.close();
|
||||
}
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ function searchOnKeyDown(ev: KeyboardEvent) {
|
||||
|
||||
if (ev.key === 'Enter' && searchSelectedIndex.value != null) {
|
||||
ev.preventDefault();
|
||||
router.push(searchResult.value[searchSelectedIndex.value].path + '#' + searchResult.value[searchSelectedIndex.value].id);
|
||||
router.pushByPath(searchResult.value[searchSelectedIndex.value].path + '#' + searchResult.value[searchSelectedIndex.value].id);
|
||||
} else if (ev.key === 'ArrowDown') {
|
||||
ev.preventDefault();
|
||||
const current = searchSelectedIndex.value ?? -1;
|
||||
|
||||
@@ -64,7 +64,7 @@ function onContextmenu(ev) {
|
||||
icon: 'ti ti-player-eject',
|
||||
text: i18n.ts.showInPage,
|
||||
action: () => {
|
||||
router.push(props.to, 'forcePage');
|
||||
router.pushByPath(props.to, 'forcePage');
|
||||
},
|
||||
}, { type: 'divider' }, {
|
||||
icon: 'ti ti-external-link',
|
||||
@@ -99,6 +99,6 @@ function nav(ev: MouseEvent) {
|
||||
return openWindow();
|
||||
}
|
||||
|
||||
router.push(props.to, ev.ctrlKey ? 'forcePage' : null);
|
||||
router.pushByPath(props.to, ev.ctrlKey ? 'forcePage' : null);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -76,7 +76,7 @@ function mount() {
|
||||
function back() {
|
||||
const prev = tabs.value[tabs.value.length - 2];
|
||||
tabs.value = [...tabs.value.slice(0, tabs.value.length - 1)];
|
||||
router.replace(prev.fullPath);
|
||||
router?.replaceByPath(prev.fullPath);
|
||||
}
|
||||
|
||||
router.useListener('change', ({ resolved }) => {
|
||||
|
||||
Reference in New Issue
Block a user