mirror of
https://github.com/hotomoe/hotomoe
synced 2024-11-28 23:08:17 +09:00
Default behavior option for MkA component
This commit is contained in:
parent
e0938e5e3a
commit
25bd82ecaa
@ -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 {
|
||||
|
@ -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,
|
||||
};
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user