diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-10-27 13:53:47 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-10-27 13:53:47 +0900 |
| commit | 25bd82ecaa3fec1cee8b8754fd5c6142a7b48b39 (patch) | |
| tree | e7494adc4c5c390b0b723ae8fe2f06a7ae094b8e /src/client | |
| parent | Add animation of context menu (diff) | |
| download | sharkey-25bd82ecaa3fec1cee8b8754fd5c6142a7b48b39.tar.gz sharkey-25bd82ecaa3fec1cee8b8754fd5c6142a7b48b39.tar.bz2 sharkey-25bd82ecaa3fec1cee8b8754fd5c6142a7b48b39.zip | |
Default behavior option for MkA component
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/components/ui/a.vue | 11 | ||||
| -rw-r--r-- | src/client/pages/settings/api.vue | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/client/components/ui/a.vue b/src/client/components/ui/a.vue index dce99ef676..8460c90b16 100644 --- a/src/client/components/ui/a.vue +++ b/src/client/components/ui/a.vue @@ -31,6 +31,10 @@ export default defineComponent({ type: String, required: false, }, + behavior: { + type: String, + required: false, + }, }, computed: { @@ -84,6 +88,13 @@ export default defineComponent({ }, nav() { + if (this.behavior) { + if (this.behavior === 'window') { + os.pageWindow(this.to); + return; + } + } + if (this.navHook) { this.navHook(this.to); } else { diff --git a/src/client/pages/settings/api.vue b/src/client/pages/settings/api.vue index 4f14aa1ba7..6a311cdc8b 100644 --- a/src/client/pages/settings/api.vue +++ b/src/client/pages/settings/api.vue @@ -6,7 +6,7 @@ </div> </div> <div class="_section"> - <MkA to="/api-console">API console</MkA> + <MkA to="/api-console" :behavior="isDesktop ? 'window' : null">API console</MkA> </div> </div> </template> @@ -33,6 +33,7 @@ export default defineComponent({ icon: faKey }] }, + isDesktop: window.innerWidth >= 1100, }; }, |