Skip to content

Commit

Permalink
feat: add upgrade prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
vince292007 committed Jul 31, 2024
1 parent b0c0b91 commit ea5c66b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/layouts/default/header/components/UpgradePrompt.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script setup lang="ts">
import { h } from 'vue';
import { Modal } from 'ant-design-vue';
Modal.info({
title: '新版本发布',
content: h('div', {}, [h('p', 'Vben Admin v5.0.0 预览版本已发布')]),
onOk() {
handleClick();
},
okText: '前往体验新版',
});
function handleClick() {
window.open('https://www.vben.pro', '_blank');
}
</script>
<template>
<div>
<a-button type="primary" @click="handleClick">前往体验新版</a-button>
</div>
</template>
3 changes: 3 additions & 0 deletions src/layouts/default/header/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

<!-- action -->
<div :class="`${prefixCls}-action`">
<UpgradePrompt class="mr-2" />

<AppSearch v-if="getShowSearch" :class="`${prefixCls}-action__item `" />

<ErrorAction v-if="getUseErrorHandle" :class="`${prefixCls}-action__item error-action`" />
Expand Down Expand Up @@ -70,6 +72,7 @@
import { createAsyncComponent } from '@/utils/factory/createAsyncComponent';
import { propTypes } from '@/utils/propTypes';
import UpgradePrompt from './components/UpgradePrompt.vue';
import LayoutMenu from '../menu/index.vue';
import LayoutTrigger from '../trigger/index.vue';
import { ErrorAction, FullScreen, LayoutBreadcrumb, Notify, UserDropDown } from './components';
Expand Down

0 comments on commit ea5c66b

Please sign in to comment.