使用element notification
This commit is contained in:
parent
376bcc4a0b
commit
fe44c35406
BIN
public/css/fonts/element-icons.ttf
Normal file
BIN
public/css/fonts/element-icons.ttf
Normal file
Binary file not shown.
BIN
public/css/fonts/element-icons.woff
Normal file
BIN
public/css/fonts/element-icons.woff
Normal file
Binary file not shown.
@ -15,6 +15,7 @@ import MarkdownPreview from "./MDEditor/components/preview";
|
|||||||
Vue.component('MarkdownPreview', MarkdownPreview)
|
Vue.component('MarkdownPreview', MarkdownPreview)
|
||||||
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { Notification } from 'element-ui';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AppDown',
|
name: 'AppDown',
|
||||||
@ -50,18 +51,16 @@ export default {
|
|||||||
let latestVersion = $A.leftDelete(data.tag_name.toLowerCase(), "v")
|
let latestVersion = $A.leftDelete(data.tag_name.toLowerCase(), "v")
|
||||||
if (this.compareVersion(latestVersion, currentVersion) === 1) {
|
if (this.compareVersion(latestVersion, currentVersion) === 1) {
|
||||||
// 有新版本
|
// 有新版本
|
||||||
this.$Notice.close("app-down");
|
const h = this.$createElement;
|
||||||
this.$nextTick(() => {
|
window.__appNotification && window.__appNotification.close();
|
||||||
this.$Notice.info({
|
window.__appNotification = Notification({
|
||||||
name: "app-down",
|
|
||||||
title: this.$L("更新提示"),
|
title: this.$L("更新提示"),
|
||||||
duration: 0,
|
duration: 0,
|
||||||
|
position: "bottom-right",
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
// 关闭提示后显示更新按钮
|
|
||||||
this.repoStatus = 2;
|
this.repoStatus = 2;
|
||||||
},
|
},
|
||||||
render: h => {
|
message: h('span', [
|
||||||
return h('span', [
|
|
||||||
h('span', [
|
h('span', [
|
||||||
h('span', this.$L('发现新版本') + ": "),
|
h('span', this.$L('发现新版本') + ": "),
|
||||||
h('Tag', {
|
h('Tag', {
|
||||||
@ -95,9 +94,7 @@ export default {
|
|||||||
h('span', this.$L('立即升级'))
|
h('span', this.$L('立即升级'))
|
||||||
]),
|
]),
|
||||||
])
|
])
|
||||||
}
|
|
||||||
});
|
});
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.common-app-down-body {
|
.common-app-down-body {
|
||||||
max-height: 168px;
|
max-height: 175px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
margin: 18px 0;
|
margin: 18px 0;
|
||||||
.markdown-preview {
|
.markdown-preview {
|
||||||
|
2
resources/assets/sass/element.scss
vendored
2
resources/assets/sass/element.scss
vendored
@ -6,12 +6,14 @@ $--dropdown-menuItem-hover-fill: #f4f5f7;
|
|||||||
$--dropdown-menuItem-hover-color: #606266;
|
$--dropdown-menuItem-hover-color: #606266;
|
||||||
|
|
||||||
@import "~element-ui/packages/theme-chalk/src/common/transition";
|
@import "~element-ui/packages/theme-chalk/src/common/transition";
|
||||||
|
@import "~element-ui/packages/theme-chalk/src/icon";
|
||||||
@import "~element-ui/packages/theme-chalk/src/avatar";
|
@import "~element-ui/packages/theme-chalk/src/avatar";
|
||||||
@import "~element-ui/packages/theme-chalk/src/tooltip";
|
@import "~element-ui/packages/theme-chalk/src/tooltip";
|
||||||
@import "~element-ui/packages/theme-chalk/src/popover";
|
@import "~element-ui/packages/theme-chalk/src/popover";
|
||||||
@import "~element-ui/packages/theme-chalk/src/dropdown";
|
@import "~element-ui/packages/theme-chalk/src/dropdown";
|
||||||
@import "~element-ui/packages/theme-chalk/src/dropdown-menu";
|
@import "~element-ui/packages/theme-chalk/src/dropdown-menu";
|
||||||
@import "~element-ui/packages/theme-chalk/src/dropdown-item";
|
@import "~element-ui/packages/theme-chalk/src/dropdown-item";
|
||||||
|
@import "~element-ui/packages/theme-chalk/src/notification";
|
||||||
|
|
||||||
|
|
||||||
.el-dropdown-menu__item {
|
.el-dropdown-menu__item {
|
||||||
|
BIN
resources/assets/statics/public/css/fonts/element-icons.ttf
Normal file
BIN
resources/assets/statics/public/css/fonts/element-icons.ttf
Normal file
Binary file not shown.
BIN
resources/assets/statics/public/css/fonts/element-icons.woff
Normal file
BIN
resources/assets/statics/public/css/fonts/element-icons.woff
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user