相关文章推荐
满身肌肉的高山  ·  vue 报错 ...·  3 周前    · 
好帅的棒棒糖  ·  在用Android ...·  1 年前    · 
重情义的椰子  ·  String.Contains 方法 ...·  1 年前    · 
单身的菠萝  ·  TiDB 4.0.9 Release ...·  2 年前    · 
纯真的骆驼  ·  查看包对象 - SQL Server ...·  2 年前    · 
< router-tab > < template #default ="tab" > < div class ="title-hack" :title ="getMenuInfo(tab, 'title')" > < i class ="angle" ></ i > < span class ="tab-title" > {{ getMenuInfo(tab, 'title') }} </ span > < i v-if ="tab.closable" class ="icon iconfont i-quxiao" @click.prevent ="tab.close" /> </ div > </ template > </ router-tab > </ template > < script > export default { name: ' RoutersTab ' , methods: { * @func getMenuInfo * @returns getMenuInfo(tab) { let title = '' ; if (tab.title && tab.title !== ' 无标题 ' ) { title = tab.title; // 在需要显示动态标题的页面dat添加routeTab,或者computed 计算属性添加routeTab(推荐) } else if (tab.data && tab.data.moduleName) { title = tab.data.moduleName; return title; </ script >

在需要显示动态名称的页面添加routeTab,可以在data属性中添加,或者computed中添加

computed: {
        routeTab() {
            return this.$route.params.title;
        path: '/monthly-evaluation-socretask-detail/:id/:title',
        name: 'MonthlyEvaluationScoreTaskDetail',
        component: MonthlyEvaluationScoreTaskDetail,
        meta: {
            moduleName: '月度考评评分详情',
            key: 'fullPath'
openDetail(item) {
            let path = `/monthly-evaluation-socretask-detail/${item.id}/${item.title}`;
            this.$router.push(path);