1.1.1 • Published 11 months ago
sphere-scroll v1.1.1
sphere-scroll
Example
Install
npm install sphere-scroll
Quick Start
import SphereScroll from "sphere-scroll";
<sphere-scroll
:dataList="dataList"
@selectChange="onSelectChange"
:viewHeight="300"
:itemHeight="35"
:viewWidth="300"
>
You can see demo for more information.
Porps
porps | description | Type | Default |
---|---|---|---|
viewHeight | Component height | string/number | 350 |
viewWidth | Component width | string/number | 300 |
itemHeight | List item height | string/number | 40 |
dataList | List data | array | - |
##Events | Event Name | Description | Parameters | | ---- | ---- | ---- | | selectChange | triggers when selection changes | selcetion index|
Methods
Method | Description | Parameters |
---|---|---|
setSeclectIndex | set selection | selcetion index |
Slots
You also can use slot to apply custom content for list item.
<template v-slot:item="{ item }">
<div class="listItem">
{{ item }}
</div>
</template>