颜路在路上

关注

vue slot插槽内容过滤

颜路在路上

关注

阅读 125

2022-05-10


### parent.vue
<titleVue>{{ title }}</titleVue>


### titleVue.vue
<h3>{{ title }}</h3>
computed:{
title() {
//此处对内容进行过滤
const name = this.$slots.default[0].text;
if (this.$route.query.brole === '1') {
return name;
} else {
return name.replace('该单位', '');
}
}
}



相关推荐

kmoon_b426

vue slot 插槽

kmoon_b426 150 0 0

穿裙子的程序员

vue 插槽 【slot】

穿裙子的程序员 14 0 0

萨科潘

Vue 插槽(slot)使用

萨科潘 97 0 0

九点韶留学

vue的slot插槽

九点韶留学 99 0 0

一天清晨

[vue] slot插槽 默认插槽,具名插槽,作用域插槽

一天清晨 101 0 0

朱悟能_9ad4

vue中的slot(插槽)

朱悟能_9ad4 166 0 0

阿尚青子自由写作人

Vue 中的 slot 插槽

阿尚青子自由写作人 46 0 0

代码小姐

Vue的slot插槽(默认插槽、具名插槽、作用域插槽)

代码小姐 7 0 0

一葉_code

插槽 slot

一葉_code 150 0 0

月孛星君

vue3 插槽 slot 使用

月孛星君 21 0 0

精彩评论(0)

0 0 举报