新建页面
<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, },
里注册