first
This commit is contained in:
51
node_modules/vant/lib/sidebar/index.js
generated
vendored
Normal file
51
node_modules/vant/lib/sidebar/index.js
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _utils = require("../utils");
|
||||
|
||||
var _relation = require("../mixins/relation");
|
||||
|
||||
var _createNamespace = (0, _utils.createNamespace)('sidebar'),
|
||||
createComponent = _createNamespace[0],
|
||||
bem = _createNamespace[1];
|
||||
|
||||
var _default = createComponent({
|
||||
mixins: [(0, _relation.ParentMixin)('vanSidebar')],
|
||||
model: {
|
||||
prop: 'activeKey'
|
||||
},
|
||||
props: {
|
||||
activeKey: {
|
||||
type: [Number, String],
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data: function data() {
|
||||
return {
|
||||
index: +this.activeKey
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
activeKey: function activeKey() {
|
||||
this.setIndex(+this.activeKey);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setIndex: function setIndex(index) {
|
||||
if (index !== this.index) {
|
||||
this.index = index;
|
||||
this.$emit('change', index);
|
||||
}
|
||||
}
|
||||
},
|
||||
render: function render() {
|
||||
var h = arguments[0];
|
||||
return h("div", {
|
||||
"class": bem()
|
||||
}, [this.slots()]);
|
||||
}
|
||||
});
|
||||
|
||||
exports.default = _default;
|
Reference in New Issue
Block a user