Код: Выделить всё
@ionic_vue.js?v=bbc2dfce:18984 TypeError: animationBuilder is not a function at animation (chunk-YNRD7USV.js?v=bbc2dfce:838:17)
Код: Выделить всё
Код: Выделить всё
import { useIonRouter } from '@ionic/vue';
const ionRouter = useIonRouter();
function clickLink() {
ionRouter.push(url.value);
}
Код: Выделить всё
export function useCustomRouter() {
const router = useIonRouter();
const { activeOrganizationId } = useDaily();
async function push(path: any) {
try{
await router.push(path, 'forward');
} catch (e) {
//console.error(e);
}
}
async function back() {
try{
await router.back('none');
} catch (e) {
//console.error(e);
}
}
async function goHome() {
try{
await router.push(`/${activeOrganizationId.value}/app/my-day`, 'forward');
} catch (e) {
//console.error(e);
}
}
return {
push,
back,
goHome,
};
}
< /code>
, а затем используйте его. < /p>
import { useCustomRouter } from '~/composables/useCustomRouter';
const router = useCustomRouter();
function clickLink() {
router.push(url.value)
}
< /code>
Я получаю проблему анимации в консоли, и единственное исправление, которое я нашел, помимо установки анимированного: false использует ноаанимацию, как вы можете видеть ниже: < /p>
import { type AnimationBuilder, createAnimation } from '@ionic/vue';
export function useCustomRouter() {
const noAnimation: AnimationBuilder = (baseEl, opts) => {
return createAnimation().addElement(baseEl).duration(0);
};
const router = useIonRouter();
const { activeOrganizationId } = useDaily();
async function push(path: any) {
try{
await router.push(path, noAnimation);
} catch (e) {
//console.error(e);
}
}
async function back() {
try{
await router.back(noAnimation);
} catch (e) {
//console.error(e);
}
}
async function goHome() {
try{
await router.push(`/${activeOrganizationId.value}/app/my-day`, 'forward');
} catch (e) {
//console.error(e);
}
}
return {
push,
back,
goHome,
};
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... a-function
Мобильная версия