|
1 | 1 | <template> |
2 | 2 | <v-app class="content"> |
3 | | - <v-navigation-drawer app v-model="drawer" :mini-variant.sync="mini" mini-variant-width=50 width=200 permanent> |
| 3 | + <v-navigation-drawer class="nav" app v-model="drawer" :mini-variant.sync="mini" v-on:mouseover.native="mini=false" v-on:mouseleave.native="mini=true" mini-variant-width=50 width=200 permanent> |
4 | 4 | <v-list> |
5 | 5 | <v-btn icon @click.stop="mini = !mini"> |
6 | 6 | <v-icon>menu</v-icon> |
7 | 7 | </v-btn> |
8 | 8 | <template v-for="(item, index) in sites"> |
9 | 9 | <v-list-tile :key="index" ripple :class="{'mini-tile':mini}" @click="siteItemClick(index)"> |
10 | 10 | <v-list-tile-action> |
11 | | - <v-img :src="getFavicon(item.src)" max-width="16px" position="left center"></v-img> |
| 11 | + <v-badge v-if="feedCount[item.feed]>0&&mini" overlap color="cyan"><span slot="badge">{{feedCount[item.feed]}}</span> |
| 12 | + <v-img :src="getFavicon(item.src)" width="20px" position="left center"></v-img> |
| 13 | + </v-badge> |
| 14 | + <v-img v-else :src="getFavicon(item.src)" max-width="16px" position="left center"></v-img> |
12 | 15 | </v-list-tile-action> |
13 | 16 | <v-list-tile-content> |
14 | | - <v-badge v-if="feedCount[item.feed]>0" color="grey"><span slot="badge">{{feedCount[item.feed]}}</span><span v-show="1">{{item.title}}</span></v-badge><span v-else>{{item.title}}</span> |
| 17 | + <v-badge v-if="feedCount[item.feed]>0" color="cyan"><span slot="badge">{{feedCount[item.feed]}}</span><span>{{item.title}}</span></v-badge><span v-else>{{item.title}}</span> |
15 | 18 | </v-list-tile-content> |
16 | 19 | </v-list-tile> |
17 | 20 | <!-- <v-divider v-if="index + 1 < sites.length" :key="`site-${index}`"></v-divider> --> |
@@ -65,7 +68,7 @@ export default { |
65 | 68 | return { |
66 | 69 | fab: false, |
67 | 70 | drawer: true, |
68 | | - mini: false, |
| 71 | + mini: true, |
69 | 72 | webViewSrc: "https://www.v2ex.com/", |
70 | 73 | sites: [ |
71 | 74 | { |
@@ -104,6 +107,18 @@ export default { |
104 | 107 | methods: { |
105 | 108 | ...mapActions(["setLoadingState"]), |
106 | 109 | saveHtml() { |
| 110 | + const notification = { |
| 111 | + title: "基本通知", |
| 112 | + body: "简短的通知内容" |
| 113 | + }; |
| 114 | + const myNotification = new window.Notification( |
| 115 | + notification.title, |
| 116 | + notification |
| 117 | + ); |
| 118 | + myNotification.onclick = () => { |
| 119 | + console.log("通知被点击"); |
| 120 | + }; |
| 121 | +
|
107 | 122 | var path = |
108 | 123 | this.appPath + |
109 | 124 | this.$refs.webView |
@@ -206,6 +221,13 @@ export default { |
206 | 221 | margin-top: -5px; |
207 | 222 | z-index: 99; |
208 | 223 | } |
| 224 | +.nav { |
| 225 | + background-color: hsl(0, 0%, 96%) !important; |
| 226 | +} |
| 227 | +.v-badge__badge { |
| 228 | + width: 18px !important; |
| 229 | + height: 18px !important; |
| 230 | +} |
209 | 231 | </style> |
210 | 232 |
|
211 | 233 |
|
0 commit comments