1.0.0 • Published 4 years ago
ocass_modules v1.0.0
复用组件
输入框替换文本组件:ReplaceInput
- 使用方式:下面 h2 点击以后会变成 input 可以进行实时编辑
<ReplaceInput id="test">
<h2 id="test">123</h2>
</ReplaceInput>
- 共有两个参数
- id * :向组件传递插槽里 文本绑定的 id
- type : input\textarea 默认为 input
列表尾部占位符:AddItem
- 使用方式:在v-for后面使用,用一个和遍历出来的item一样的class的父级包裹或直接不用父级直接设置class也可以(这里class为li)
<div class="li" v-for="(item, index) in list" :key="index">
{{ item.text }}
</div>
<AddItem
class="li"
:listLength="list.length"
:rowLength="3"
fontSize="50"
/>
- 参数:
- listLength:前面vfor遍历的list的长度
- rowLength: 一行显示多少个(如果listLength刚好铺满,则该组件将会隐藏)
- fontSize: 里面加号的大小
1.0.0
4 years ago