Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): Splitter Image examples - remove scrollbars #3254

Merged
merged 4 commits into from
Feb 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions docs/src/examples/QSplitter/ImageFun.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<template>
<div>
<q-resize-observer @resize="onResize" />
<q-splitter
id="photos"
v-model="splitterModel"
:limits="[0, 100]"
style="height: 300px; width: 400px;"
:style="splitterStyle"
class="no-scroll"
>

<template v-slot:before class="no-scroll">
Expand Down Expand Up @@ -34,11 +36,26 @@ export default {
width: 400,
splitterModel: 50 // start at 50%
}
},
methods: {
// we are using q-resize-observer to keep this example mobile-friendly
onResize (size) {
let potentialWidth = Math.abs(size.width)
this.width = Math.min(potentialWidth, 400)
}
},
computed: {
splitterStyle () {
return {
height: '300px',
width: this.width + 'px'
}
}
}
}
</script>
<style>
/* .q-splitter__before, .q-splitter__after { */
/* overflow: hidden !important; */
/* } */
.no-scroll > .q-splitter__before, .no-scroll > .q-splitter__after {
overflow: hidden !important;
}
</style>
6 changes: 6 additions & 0 deletions docs/src/examples/QSplitter/ReactiveImages.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<q-splitter
v-model="splitterModel"
style="height: 400px"
class="no-scroll"
>

<template v-slot:before>
Expand Down Expand Up @@ -32,3 +33,8 @@ export default {
}
}
</script>
<style>
.no-scroll > .q-splitter__before, .no-scroll > .q-splitter__after {
overflow: hidden !important;
}
</style>
4 changes: 4 additions & 0 deletions docs/src/pages/vue-components/splitter.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
title: QSplitter
related:
- /vue-components/expansion-item
- /vue-components/slide-item
- /vue-components/separator
---

The QSplitter component allow containers to be split vertically and/or horizontally through a draggable separator bar.
Expand Down
2 changes: 1 addition & 1 deletion quasar/src/components/splitter/QSplitter.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"props": {
"value": {
"type": "Number",
"desc": "Model of the component defining the split ratio (0.0 < x < 100.0) beetween panes; Either use this property (along with a listener for 'input' event) OR use v-model directive",
"desc": "Model of the component defining the split ratio percent (0.0 < x < 100.0) between panes; Either use this property (along with a listener for 'input' event) OR use v-model directive",
"examples": [ "v-model=\"ratio\"" ]
},

Expand Down