vue父页面传递样式给子页面,和router用法
vue父子页面样式传递
·
父页面定义样式:
formContainerStyle:'height: calc(90vh - 270px);overflow-y: auto;padding-left:20px;padding-right:20px'
调用
<company-regulation
:formContainerStyle="formContainerStyle"
>
</company-regulation>
子页面
props: {
formContainerStyle: {
required: false,
default: 'height: calc(90vh - 270px);overflow-y: auto;padding-left:20px;padding-right:20px'
}
}
<div :style="formContainerStyle">
二 路由用法
1 路由路径
2 路由配置
/** 当路由太多可以将路由分离成小模块 **/
import Layout from '@/layout'
const dictRouter = {
path: '/companyLayout',
component: Layout,
hidden: true,
children: [{
path: 'meet/meetNum',
component: () => import('@/views/company/meeting/meetingAnalyse/meetingMotions'),
name: 'Data',
meta: {
title: '会议数量',
icon: ''
}
},{
path: 'person/relatedPerson',
component: () => import('@/views/company/related/relatedUser'),
name: 'relatedPerson',
meta: {
title: '相关方添加',
icon: ''
}
}]
}
export default dictRouter
3 vue页面两种调用方式
1
this.$router.push('/companyLayout/person/relatedPerson')
2
<el-table-column label="会议数量" align="center" prop="meetingTypeNum">
<template slot-scope="scope">
<router-link
:to="{path:'/companyLayout/meet/meetNum',
query:{searchType:'0',companyCode:queryParams.companyCode,meetingTime:meetingTime,meetingType:scope.row.meetingType,
conveneWay:queryParams.conveneWay,meetingNoticeType:queryParams.meetingNoticeType}}"
class="link-type">
<span>{{ scope.row.meetingTypeNum }}</span>
</router-link>
</template>
</el-table-column>
更多推荐
已为社区贡献1条内容
所有评论(0)