Default behavior option for MkA component

This commit is contained in:
syuilo 2020-10-27 13:53:47 +09:00
parent c2d2c5b2be
commit d62474969b
2 changed files with 13 additions and 1 deletions

View File

@ -31,6 +31,10 @@ export default defineComponent({
type: String, type: String,
required: false, required: false,
}, },
behavior: {
type: String,
required: false,
},
}, },
computed: { computed: {
@ -84,6 +88,13 @@ export default defineComponent({
}, },
nav() { nav() {
if (this.behavior) {
if (this.behavior === 'window') {
os.pageWindow(this.to);
return;
}
}
if (this.navHook) { if (this.navHook) {
this.navHook(this.to); this.navHook(this.to);
} else { } else {

View File

@ -6,7 +6,7 @@
</div> </div>
</div> </div>
<div class="_section"> <div class="_section">
<MkA to="/api-console">API console</MkA> <MkA to="/api-console" :behavior="isDesktop ? 'window' : null">API console</MkA>
</div> </div>
</div> </div>
</template> </template>
@ -33,6 +33,7 @@ export default defineComponent({
icon: faKey icon: faKey
}] }]
}, },
isDesktop: window.innerWidth >= 1100,
}; };
}, },