1.在components文件下创建sb-tip文件夹创建sb-tip.vue
<template>
<view>
<slot name="left"></slot>
<view class="more" @click="$emit('right')">
{{ subText }}
</view>
</view>
</template>
<script>
export default {
name:"sb-tip",
props:['subText'],
data(){
return {
}
}
}
</script>
<style>
</style>
2.页面引用
<sb-tip sub-text='更多' @right='handleClick'>
<template #left>标题</template>
</sb-tip>