Commit 61be7206 by 段启岩

样式优化

parent 98f7a988
<template>
<div class="bc-layout-container-header">
<notifications class="message-tip-box"/>
<div class="nuxt-progress" v-if="progressShow"></div>
<div class="container-header" v-if="!showDetailHead">
<div class="header-center">
......@@ -131,7 +132,6 @@
<div class="click-top" v-if="showToTop" @click="clickToTop">
<div class="click-top__triangle"></div>
</div>
<notifications/>
</div>
</template>
......@@ -211,18 +211,17 @@
},
sockets: {
connect(data) {
console.log('connect.')
this.$notify({
title: '连接消息',
text: 'websocket连接成功',
type: 'success'
});
},
push_event(data) {
console.log(data)
this.$notify({
title: '新消息',
text: JSON.stringify(data),
type: 'success'
duration: 2000
});
}
},
......@@ -391,6 +390,45 @@
<style lang="scss">
.bc-layout-container-header{
.message-tip-box {
// Style of the notification itself
position: fixed;
z-index: 9999;
top: 10px !important;
right: 6px !important;
.vue-notification-wrapper {
margin-bottom: 10px;
.vue-notification {
color: #333333;
background-color: #F4F8FA;
border: 1px solid #eeeeee;
border-radius: 6px;
opacity: .9;
transition: all .3s;
.notification-title {
// Style for title line
padding: 2px 6px;
}
.notification-content {
padding: 2px 6px;
}
}
&.my-type {
/*
Style for specific type of notification, will be applied when you
call notification with "type" parameter:
this.$notify({ type: 'my-type', message: 'Foo' })
*/
}
}
}
.nuxt-progress{
position: fixed;
top: 0;
......
......@@ -9,14 +9,13 @@ export default function ({ app: { router }, store }) {
const auth = store.state.auth;
if (auth.authenticated) {
console.log("检测到用户已登录,正在初始化websocket连接.")
const socket = new VueSocketIO({
Vue.use(new VueSocketIO({
debug: true,
connection: socketio('http://api.opensource.yundingshuyuan.com', {
query: 'token=' + auth.token
}),
options: { path: "/socket.io" }
})
Vue.use(socket)
}))
}
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment