props 属性
slots 插槽
events 事件
methods 方法
![](https://img.haomeiwen.com/i12150081/666a6eacc36f34f1.jpg)
1、import {XHeader} from 'vux';
2、export default {
name: 'App',
components: {
XHeader
}
}
3、<x-header></x-header>
在index.html中 最上面添加 <meta name="viewport" content="width=device-width,initial-scale=1.0">
通过添加属性props的方式来写 写的时候要这样写 记得加冒号:
![](https://img.haomeiwen.com/i12150081/8d0866eac0ef2495.png)
![](https://img.haomeiwen.com/i12150081/2314ae2f93432156.png)
通过添加插槽slot的方式来写
直接在x-header里面写div 记得把默认的左右给设置为false 不然会占位挤下去
![](https://img.haomeiwen.com/i12150081/ab4f9e97ab10964e.png)
![](https://img.haomeiwen.com/i12150081/b0f5efad9b12e310.png)
网友评论