新建页面
<div class="tlt_header">
<van-nav-bar
:title="this.headers"
left-text=""
left-arrow
@click-left="onClickLeft"
@click-right="onClickRight"
fixed
style="z-index: 900;"
/>
</div>
class name为标签名
点击事件可以直接写在本页面,也可以写在调用页面。
props:{
headers:{
type: null,
},
save:{
type:Function,
},
carry:{
type:Function,
},
titles:{
type:Function,
}
},
在porps中定义传值类型,可以是任意类型,
在引用页使用方法:
<tlt_header :headers=head></tlt_header>
在 template 写上标签,:headers为应用页面调用值,,head为传输值。
import tlt_header from "../component/tlt_header";
引入调用文件
在
components: {
tlt_header, order_detail_passenger,
},
里注册
本文介绍如何创建一个名为tlt_header的Vue组件,详细解释了如何设置属性、事件和在其他页面中调用该组件的方法。通过实例展示了如何在props中定义不同类型的数据,并在引用页使用这些值。
344

被折叠的 条评论
为什么被折叠?



