Gets the current view mode in the editor, which can be either 'DESKTOP'
or ‘MOBILE’
. This enables you to show different options in your settings panel depending on whether the user is viewing the desktop or mobile versions of their site.
function getViewMode(): Promise<string>
This method does not take any parameters.
Promise<string>
The current view mode in the editor, which can be either 'DESKTOP'
or ‘MOBILE’
.
import { editor, info } from "@wix/editor";
import { createClient } from "@wix/sdk";
const client = createClient({
host: editor.host(),
modules: { info },
});
async function getViewMode() {
const response = await client.info.getViewMode();
}