|
27 | 27 | A Vue Component |
28 | 28 | <span class="is-pulled-right"> |
29 | 29 | <!-- Place this tag where you want the button to render. --> |
30 | | -<a class="github-button" href="https://github.com/PygmySlowLoris/vue-fab" data-icon="octicon-star" data-size="large" aria-label="Star PygmySlowLoris/vue-fab on GitHub">Star</a> |
| 30 | +<a class="github-button" href="https://github.com/PygmySlowLoris/vue-fab" data-icon="octicon-star" data-size="large" |
| 31 | + aria-label="Star PygmySlowLoris/vue-fab on GitHub">Star</a> |
31 | 32 | </span> |
32 | 33 | </h2> |
33 | 34 | </div> |
|
52 | 53 | </div> |
53 | 54 | <div class="content"> |
54 | 55 | <div class="columns"> |
55 | | - <div class="column is-5" style="display: flex; justify-content: center"> |
| 56 | + <div class="column is-4" style="display: flex; justify-content: center"> |
56 | 57 | <div class="field is-pulled-left"> |
57 | 58 | <label class="label">Color</label> |
58 | 59 | <p class="control"> |
|
61 | 62 | </div> |
62 | 63 | </div> |
63 | 64 | <div class="column"> |
64 | | - <div class="field has-text-left"> |
65 | | - <label class="label">Position</label> |
66 | | - <p class="control"> |
67 | | - <span class="select"> |
68 | | - <select v-model="position"> |
69 | | - <option v-for="pos in positions">{{pos}}</option> |
70 | | - </select> |
71 | | - </span> |
72 | | - </p> |
| 65 | + <div class="field is-horizontal"> |
| 66 | + <div class="field-body"> |
| 67 | + <div class="field has-text-left"> |
| 68 | + <label class="label">Position</label> |
| 69 | + <p class="control is-expanded"> |
| 70 | + <span class="select is-fullwidth"> |
| 71 | + <select v-model="position"> |
| 72 | + <option v-for="pos in positions">{{pos}}</option> |
| 73 | + </select> |
| 74 | + </span> |
| 75 | + </p> |
| 76 | + </div> |
| 77 | + <div class="field has-text-left"> |
| 78 | + <label class="label">Position Type</label> |
| 79 | + <p class="control is-expandend"> |
| 80 | + <span class="select is-fullwidth"> |
| 81 | + <select v-model="positionType"> |
| 82 | + <option v-for="type in positionTypes">{{type}}</option> |
| 83 | + </select> |
| 84 | + </span> |
| 85 | + </p> |
| 86 | + </div> |
| 87 | + <div class="field has-text-left"> |
| 88 | + <label class="label">Size</label> |
| 89 | + <p class="control is-expandend"> |
| 90 | + <span class="select is-fullwidth"> |
| 91 | + <select v-model="iconSizes"> |
| 92 | + <option v-for="size in sizes">{{size}}</option> |
| 93 | + </select> |
| 94 | + </span> |
| 95 | + </p> |
| 96 | + </div> |
| 97 | + <div class="field has-text-left"> |
| 98 | + <label class="label">Tooltip event</label> |
| 99 | + <p class="control is-expandend"> |
| 100 | + <span class="select is-fullwidth"> |
| 101 | + <select v-model="tooltipEvent"> |
| 102 | + <option v-for="type in tooltipEvents">{{type}}</option> |
| 103 | + </select> |
| 104 | + </span> |
| 105 | + </p> |
| 106 | + </div> |
| 107 | + </div> |
73 | 108 | </div> |
74 | | - <label class="label" style="display: flex; align-items: center; padding-right: 1rem;"> |
| 109 | + <label class="label" |
| 110 | + style="display: flex; align-items: center; padding-right: 1rem;"> |
75 | 111 | Main Icon & Tooltip |
76 | 112 | </label> |
77 | 113 | <div class="field is-horizontal"> |
|
88 | 124 | </div> |
89 | 125 | </div> |
90 | 126 | </div> |
91 | | - <label class="label" style="display: flex; align-items: center; padding-right: 1rem;"> |
| 127 | + <label class="label" |
| 128 | + style="display: flex; align-items: center; padding-right: 1rem;"> |
92 | 129 | First Icon & Tooltip |
93 | 130 | </label> |
94 | 131 | <div class="field is-horizontal"> |
|
105 | 142 | </div> |
106 | 143 | </div> |
107 | 144 | </div> |
108 | | - <label class="label" style="display: flex; align-items: center; padding-right: 1rem;"> |
| 145 | + <label class="label" |
| 146 | + style="display: flex; align-items: center; padding-right: 1rem;"> |
109 | 147 | Second Icon & Tooltip |
110 | 148 | </label> |
111 | 149 | <div class="field is-horizontal"> |
|
152 | 190 | </footer> |
153 | 191 | <fab |
154 | 192 | :position="position" |
| 193 | + :icon-size="iconSizes" |
| 194 | + :position-type="positionType" |
155 | 195 | :bg-color="colors.hex" |
156 | 196 | :main-icon="mainIcon" |
157 | 197 | :main-tooltip="mainTooltip" |
158 | 198 | :actions="[{name: 'alertMe',icon: firstIcon, tooltip: firstTooltip, color:'#d11014'},{name: 'alertMe',icon: secondIcon, tooltip: secondTooltip}]" |
159 | 199 | @alertMe="alert" |
| 200 | + :fixed-tooltip="fixedTooltip" |
160 | 201 | ></fab> |
161 | 202 | </div> |
162 | 203 | </template> |
|
207 | 248 | 'top-right', |
208 | 249 | 'top-left', |
209 | 250 | ], |
| 251 | + positionTypes: [ |
| 252 | + 'fixed', |
| 253 | + 'absolute' |
| 254 | + ], |
| 255 | + tooltipEvents: [ |
| 256 | + 'hover', |
| 257 | + 'fixed' |
| 258 | + ], |
| 259 | + sizes: [ |
| 260 | + 'small', |
| 261 | + 'medium', |
| 262 | + 'large' |
| 263 | + ], |
210 | 264 | position: 'bottom-right', |
| 265 | + positionType: 'fixed', |
| 266 | + tooltipEvent: 'hover', |
| 267 | + iconSizes: 'medium', |
211 | 268 | colors: defaultProps, |
212 | 269 | mainIcon: 'add', |
213 | 270 | mainTooltip: 'Hello', |
|
217 | 274 | secondTooltip: 'add_alert' |
218 | 275 | } |
219 | 276 | }, |
| 277 | + computed: { |
| 278 | + fixedTooltip() { |
| 279 | + return this.tooltipEvent === 'fixed'; |
| 280 | + } |
| 281 | + }, |
220 | 282 | methods: { |
221 | 283 | alert(){ |
222 | 284 | alert('You have clicked me :)'); |
|
250 | 312 | border-top: dashed 1px; |
251 | 313 | } |
252 | 314 |
|
253 | | -
|
254 | 315 | li { |
255 | 316 | display: inline-block; |
256 | 317 | margin: 0 10px; |
|
292 | 353 | } |
293 | 354 |
|
294 | 355 | .vertical-separator { |
295 | | - display: flex; justify-content: space-around; |
| 356 | + display: flex; |
| 357 | + justify-content: space-around; |
296 | 358 | } |
297 | 359 |
|
298 | 360 | .vertical-separator .line { |
|
0 commit comments