mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 03:11:15 +00:00
[new feature] add IndexBar component
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
export function ChildrenMixin(parent) {
|
||||
export function ChildrenMixin(parent, options = {}) {
|
||||
const indexKey = options.indexKey || 'index';
|
||||
|
||||
return {
|
||||
inject: {
|
||||
[parent]: {
|
||||
@@ -11,7 +13,7 @@ export function ChildrenMixin(parent) {
|
||||
return this[parent];
|
||||
},
|
||||
|
||||
index() {
|
||||
[indexKey]() {
|
||||
this.bindRelation();
|
||||
return this.parent.children.indexOf(this);
|
||||
}
|
||||
|
Reference in New Issue
Block a user