refactor: drawer component

master
chenghx 6 years ago
parent e3c5f57366
commit 7b7e878c24
  1. 18
      src/components/tool/Drawer.vue

@ -10,7 +10,18 @@
<script> <script>
export default { export default {
name: 'Drawer', name: 'Drawer',
props: ['openDrawer'], props: {
openDrawer: {
type: Boolean,
required: false,
default: false
},
placement: {
type: String,
required: false,
default: 'left'
}
},
methods: { methods: {
open () { open () {
this.$emit('change', true) this.$emit('change', true)
@ -39,15 +50,14 @@ export default {
} }
.drawer{ .drawer{
position: fixed; position: fixed;
width: 256px;
height: 100%; height: 100%;
transition: all 0.5s; transition: all 0.5s;
z-index: 100; z-index: 100;
&.open{ &.open{
left: 0px; left: 0;
} }
&.close{ &.close{
left: -262px; left: -100%;
} }
.sider{ .sider{
height: 100%; height: 100%;

Loading…
Cancel
Save