diff --git a/doric-Qt/example/doric/plugin/DoricNavigatorPlugin.cpp b/doric-Qt/example/doric/plugin/DoricNavigatorPlugin.cpp index 015a14db..65c2a182 100644 --- a/doric-Qt/example/doric/plugin/DoricNavigatorPlugin.cpp +++ b/doric-Qt/example/doric/plugin/DoricNavigatorPlugin.cpp @@ -75,7 +75,21 @@ void DoricNavigatorPlugin::pop(QString jsValueString, QString callbackId) { DoricThreadMode::JS); } -void DoricNavigatorPlugin::popSelf(QString jsValueString, QString callbackId) {} +void DoricNavigatorPlugin::popSelf(QString jsValueString, QString callbackId) { + getContext()->getDriver()->asyncCall( + [this] { + QObject *window = getContext()->getQmlEngine()->rootObjects().at(0); + QMetaObject::invokeMethod(window, "navigatorPop"); + }, + DoricThreadMode::UI); + + getContext()->getDriver()->asyncCall( + [this, callbackId] { + QVariantList args; + DoricPromise::resolve(getContext(), callbackId, args); + }, + DoricThreadMode::JS); +} void DoricNavigatorPlugin::popToRoot(QString jsValueString, QString callbackId) {}