mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 02:16:12 +08:00
docs(IndexBar): use composition api
This commit is contained in:
parent
ec505d549e
commit
afd3474da3
@ -51,7 +51,7 @@ app.use(IndexAnchor);
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
data() {
|
setup() {
|
||||||
return {
|
return {
|
||||||
indexList: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
indexList: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
||||||
};
|
};
|
||||||
|
@ -55,7 +55,7 @@ app.use(IndexAnchor);
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
export default {
|
export default {
|
||||||
data() {
|
setup() {
|
||||||
return {
|
return {
|
||||||
indexList: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
indexList: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
||||||
};
|
};
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
i18n: {
|
i18n: {
|
||||||
'zh-CN': {
|
'zh-CN': {
|
||||||
@ -39,7 +41,8 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
setup() {
|
||||||
|
const activeTab = ref(0);
|
||||||
const indexList = [];
|
const indexList = [];
|
||||||
const charCodeOfA = 'A'.charCodeAt(0);
|
const charCodeOfA = 'A'.charCodeAt(0);
|
||||||
|
|
||||||
@ -48,7 +51,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
activeTab: 0,
|
activeTab,
|
||||||
indexList,
|
indexList,
|
||||||
customIndexList: [1, 2, 3, 4, 5, 6, 8, 9, 10],
|
customIndexList: [1, 2, 3, 4, 5, 6, 8, 9, 10],
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user