Skip to content

Commit 99b030a

Browse files
author
Guillaume Chau
committed
fix(ui): nav button custom image align
1 parent c427314 commit 99b030a

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

packages/@vue/cli-ui/src/components/ProjectNavButton.vue

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
<VueGroupButton
1212
class="flat big"
1313
:class="{
14-
'icon-button': !$responsive.wide
14+
'icon-button': !$responsive.wide,
15+
'has-image-icon': imageIcon
1516
}"
1617
:value="view.name"
17-
:icon-left="!imageIcon && view.icon"
18+
:icon-left="!imageIcon ? view.icon : null"
1819
>
1920
<img
2021
v-if="imageIcon"
@@ -127,6 +128,20 @@ $bg-dark = $vue-ui-color-dark
127128
.image-icon
128129
max-width 24px
129130
max-height @width
131+
.wide &
132+
margin-right 6px
133+
position relative
134+
left -2px
135+
136+
.vue-ui-group-button.has-image-icon
137+
>>> .default-slot
138+
display flex
139+
align-items center
140+
overflow visible !important
141+
.label
142+
display block
143+
max-width 150px
144+
ellipsis()
130145
131146
.badges
132147
margin ($padding-item/2) 0

packages/@vue/cli-ui/vue-cli-ui.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ module.exports = api => {
1515
api.addView({
1616
id: 'vue-webpack-test-view',
1717
name: 'test-webpack-route',
18-
icon: 'pets',
19-
// icon: 'http://localhost:4000/_plugin/%40vue%2Fcli-service/webpack-icon.svg',
18+
// icon: 'pets',
19+
icon: 'http://localhost:4000/public/webpack-logo.png',
2020
tooltip: 'Test view from webpack addon'
2121
})
2222

0 commit comments

Comments
 (0)