Skip to content

Commit

Permalink
fix: (layout) height property in header and footer now is responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
backrunner committed Feb 28, 2024
1 parent 5703db0 commit 76f8e87
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/packages/layout/components/AFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { computed, defineComponent } from 'vue';
export default defineComponent({
props: {
Expand All @@ -16,10 +16,10 @@ export default defineComponent({
},
},
setup(props) {
const height = typeof props.height === 'number' ? `${props.height}px` : props.height;
const styles = {
height: height || '',
};
const height = computed(() => typeof props.height === 'number' ? `${props.height}px` : props.height);
const styles = computed(() => ({
height: height.value || '',
}));
return {
styles,
};
Expand Down
10 changes: 5 additions & 5 deletions src/packages/layout/components/AHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { computed, defineComponent } from 'vue';
export default defineComponent({
props: {
Expand All @@ -16,10 +16,10 @@ export default defineComponent({
},
},
setup(props) {
const height = typeof props.height === 'number' ? `${props.height}px` : props.height;
const styles = {
height: height || '',
};
const height = computed(() => typeof props.height === 'number' ? `${props.height}px` : props.height);
const styles = computed(() => ({
height: height.value || '',
}));
return {
styles,
};
Expand Down

0 comments on commit 76f8e87

Please sign in to comment.