Vuetify:路由器视图中的 v-container 有什么作用?
Vuetify: what does v-container inside router-view do?
在Vuetify的pre-defined layouts中,有两段非常相似的示例代码:
<v-app>
<v-navigation-drawer app></v-navigation-drawer>
<v-toolbar app></v-toolbar>
<v-content>
<v-container fluid>
<router-view></router-view>
</v-container>
</v-content>
<v-footer app></v-footer>
</v-app>
和
<v-app>
<v-navigation-drawer app></v-navigation-drawer>
<v-toolbar app></v-toolbar>
<v-content>
<router-view>
<v-container fluid></v-container>
</router-view>
</v-content>
<v-footer app></v-footer>
</v-app>
第二个在我的应用程序中看起来更好,但它的工作原理让我很困惑。 <router-view>
被路由内容替换的时候,<router-view>
里面怎么会有<v-container>
呢?这应该达到什么目的?
当 <router-view>
没有匹配的路由时,将显示 <router-view>
的任何直接内容。它将被匹配的路由组件替换。它是占位符内容,直到路由匹配。
在Vuetify的pre-defined layouts中,有两段非常相似的示例代码:
<v-app>
<v-navigation-drawer app></v-navigation-drawer>
<v-toolbar app></v-toolbar>
<v-content>
<v-container fluid>
<router-view></router-view>
</v-container>
</v-content>
<v-footer app></v-footer>
</v-app>
和
<v-app>
<v-navigation-drawer app></v-navigation-drawer>
<v-toolbar app></v-toolbar>
<v-content>
<router-view>
<v-container fluid></v-container>
</router-view>
</v-content>
<v-footer app></v-footer>
</v-app>
第二个在我的应用程序中看起来更好,但它的工作原理让我很困惑。 <router-view>
被路由内容替换的时候,<router-view>
里面怎么会有<v-container>
呢?这应该达到什么目的?
当 <router-view>
没有匹配的路由时,将显示 <router-view>
的任何直接内容。它将被匹配的路由组件替换。它是占位符内容,直到路由匹配。