在http://quasar-framework.org/中,我有几个共享相同布局的屏幕,例如产品和客户列表。
但是,我看不到如何将数据从页面传递到他们的布局。例如,布局有一个我希望根据显示的页面更改的标题:
//Routes:
{
path: '/orders',
component: () => import('layouts/list'),
children: [
{ name: 'pickCustomer', path: '/customer', component: () => import('pages/CustomersList') },
{ name: 'pickProducts', path: '/products/:customer_id', component: () => import('pages/AddProductsList') },
{ name: 'addProduct', path: '/addproduct/:order_id/:product_id', component: () => import('pages/AddProductsList') },
{ name: 'confirmOrder', path: '/confirm/:order_id', component: () => import('pages/AddProductsList') }
]
}
//list.vue
<template>
<q-layout>
<q-layout-header>
<q-toolbar>
<q-btn
flat
round
dense
icon="chevron_left"
@click="leftDrawer = !leftDrawer"
/>
<q-toolbar-title>
{{title}}
</q-toolbar-title>
<q-btn flat round dense icon="save" label="Add" />
</q-toolbar>
<q-toolbar>
<q-toolbar-title>
<q-search v-model="search" @input="change" inverted color="none" />
</q-toolbar-title>
</q-toolbar>
</q-layout-header> </q-layout>
</template>
<script>
export default {
// name: 'LayoutName',
}
</script>
//Customers.vue
<template>
</template>
<script>
import CustomersRows from '../statics/json/customers.json'
export default {
data () {
return {
title: 'Customers', <--HOW TO PASS THIS?
}
}
}
</script>