<template>
<div class="app">
<Layout>
<Header>Header</Header>
<Content>Content</Content>
<Footer>Footer</Footer>
</Layout>
</div>
</template>
<script>
import Layout from 'xxx/Layout.vue'
import Header from 'xxx/Header.vue'
import Content from 'xxx/Content.vue'
import Footer from 'xxx/Footer.vue'
export default {
components: { Layout, Header, Content, Footer }
}
</script>
<template>
<div class="app">
<Layout>
<Header :height="64" bgColor="#f0f0f0">Header</Header>
<Content>Content</Content>
<Footer>Footer</Footer>
</Layout>
</div>
</template>
<script>
import Layout from 'xxx/Layout.vue'
import Header from 'xxx/Header.vue'
import Content from 'xxx/Content.vue'
import Footer from 'xxx/Footer.vue'
export default {
components: { Layout, Header, Content, Footer }
}
</script>
在上面的代碼中,Header組件的高度和背景顏色都被設置了。這樣可以實現網頁整體布局的自定義和優化。
需要注意的是,
下一篇mysql做庫存