dpzvc3-ui 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dpzvc3.esm.js +243 -224
- package/dist/dpzvc3.esm.js.map +1 -1
- package/dist/dpzvc3.esm.min.js +1 -1
- package/dist/dpzvc3.esm.min.js.map +1 -1
- package/dist/dpzvc3.js +57 -38
- package/dist/dpzvc3.js.map +1 -1
- package/dist/dpzvc3.min.js +1 -1
- package/dist/dpzvc3.min.js.map +1 -1
- package/dist-prod/index.html +1 -1
- package/dist-prod/main.09c75d988141f805e29c.js +2 -0
- package/dist-prod/main.09c75d988141f805e29c.js.map +1 -0
- package/dist-prod/slidebar.d7ad5de495550613661f.chunk.js +2 -0
- package/dist-prod/slidebar.d7ad5de495550613661f.chunk.js.map +1 -0
- package/package.json +1 -1
- package/src/components/radioBox/radiobox.vue +5 -4
- package/src/components/slideBar/slideBar.vue +23 -5
- package/src/views/SlideBar.vue +5 -2
- package/dist-prod/main.500d6bc40855d284c027.js +0 -2
- package/dist-prod/main.500d6bc40855d284c027.js.map +0 -1
- package/dist-prod/slidebar.3d3f48a631f03a2210c9.chunk.js +0 -2
- package/dist-prod/slidebar.3d3f48a631f03a2210c9.chunk.js.map +0 -1
package/dist/dpzvc3.js
CHANGED
|
@@ -4160,7 +4160,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `
|
|
|
4160
4160
|
justify-content: center;
|
|
4161
4161
|
flex-direction: column;
|
|
4162
4162
|
}
|
|
4163
|
-
`, "",{"version":3,"sources":["webpack://./
|
|
4163
|
+
`, "",{"version":3,"sources":["webpack://./radiobox-group.vue"],"names":[],"mappings":";AA4DA;EACE,aAAa;EACb,uBAAuB;EACvB,sBAAsB;AACxB","sourcesContent":["<template>\n <div :class=\"classes\">\n <slot />\n </div>\n</template>\n\n<script>\nimport { defineComponent, computed, watch, provide, ref } from 'vue'\n\nconst prefixCls = 'dpzvc3-radioBoxGroup'\n\nexport default defineComponent({\n name: 'RadioBoxGroup',\n props: {\n modelValue: {\n type: [String, Boolean, Number],\n default: ''\n },\n vertical: {\n type: Boolean,\n default: false\n }\n },\n emits: ['update:modelValue', 'on-change', 'on-form-change'],\n setup (props, { emit }) {\n const currentValue = ref(props.modelValue)\n\n // 提供给子组件\n provide('radioBoxGroup', {\n currentValue,\n change: (val) => {\n currentValue.value = val\n emit('update:modelValue', val)\n emit('on-change', val)\n emit('on-form-change', val)\n }\n })\n\n // 监听外部 v-model 改变\n watch(\n () => props.modelValue,\n (val) => {\n currentValue.value = val\n }\n )\n\n const classes = computed(() => [\n prefixCls,\n { [`${prefixCls}-vertical`]: props.vertical }\n ])\n\n return {\n classes,\n currentValue\n }\n }\n})\n</script>\n\n<style scoped>\n.dpzvc3-radioBoxGroup-vertical {\n display: flex;\n justify-content: center;\n flex-direction: column;\n}\n</style>\n"],"sourceRoot":""}]);
|
|
4164
4164
|
// Exports
|
|
4165
4165
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
4166
4166
|
|
|
@@ -4811,7 +4811,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `
|
|
|
4811
4811
|
display: flex;
|
|
4812
4812
|
flex-direction: column;
|
|
4813
4813
|
}
|
|
4814
|
-
`, "",{"version":3,"sources":["webpack://./
|
|
4814
|
+
`, "",{"version":3,"sources":["webpack://./checkbox-group.vue"],"names":[],"mappings":";AAqEA;EACE,aAAa;EACb,sBAAsB;AACxB","sourcesContent":["<template>\n <div\n :class=\"[\n 'dpzvc3-checkBoxGroup',\n vertical ? 'dpzvc3-checkBoxGroup-vertical' : ''\n ]\"\n >\n <slot />\n </div>\n</template>\n\n<script>\nimport { defineComponent, ref, watch, provide } from 'vue'\n// import Emitter from '../../mixin/emitter'\n\nexport default defineComponent({\n name: 'CheckBoxGroup',\n // mixins: [Emitter],\n\n props: {\n modelValue: {\n type: Array,\n default: () => []\n },\n single: {\n type: Boolean,\n default: false\n },\n vertical: {\n type: Boolean,\n default: false\n }\n },\n\n emits: ['update:modelValue', 'on-change'],\n\n setup (props, { emit }) {\n // alert(props)\n const currentValue = ref([...props.modelValue])\n\n /** 对外暴露给 checkbox 的方法 */\n const toggleOption = (label) => {\n let newValue = []\n newValue = [...label]\n // currentValue.value = newValue\n emit('update:modelValue', newValue)\n emit('on-change', newValue)\n }\n\n /** 提供给子 checkbox */\n provide('CheckBoxGroup', {\n currentValue,\n toggleOption\n // single: props.single\n })\n\n watch(\n () => props.modelValue,\n (val) => {\n currentValue.value = [...val]\n }\n )\n\n return {}\n }\n})\n</script>\n\n<style scoped>\n.dpzvc3-checkBoxGroup-vertical {\n display: flex;\n flex-direction: column;\n}\n</style>\n"],"sourceRoot":""}]);
|
|
4815
4815
|
// Exports
|
|
4816
4816
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
4817
4817
|
|
|
@@ -11158,10 +11158,10 @@ const picker_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(pickervue_t
|
|
|
11158
11158
|
*/
|
|
11159
11159
|
|
|
11160
11160
|
/* harmony default export */ const components_picker = (picker);
|
|
11161
|
-
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[7].use[0]!./src/components/radioBox/radiobox.vue?vue&type=template&id=
|
|
11161
|
+
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[7].use[0]!./src/components/radioBox/radiobox.vue?vue&type=template&id=1ec5a25f
|
|
11162
11162
|
|
|
11163
|
-
var
|
|
11164
|
-
function
|
|
11163
|
+
var radioboxvue_type_template_id_1ec5a25f_hoisted_1 = ["disabled", "checked"];
|
|
11164
|
+
function radioboxvue_type_template_id_1ec5a25f_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11165
11165
|
return (0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("label", {
|
|
11166
11166
|
"class": (0,external_vue_.normalizeClass)(_ctx.classes)
|
|
11167
11167
|
}, [(0,external_vue_.createElementVNode)("span", {
|
|
@@ -11176,7 +11176,7 @@ function radioboxvue_type_template_id_12c1d7f9_render(_ctx, _cache, $props, $set
|
|
|
11176
11176
|
onChange: _cache[0] || (_cache[0] = function () {
|
|
11177
11177
|
return _ctx.handleChange && _ctx.handleChange.apply(_ctx, arguments);
|
|
11178
11178
|
})
|
|
11179
|
-
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */,
|
|
11179
|
+
}, null, 42 /* CLASS, PROPS, NEED_HYDRATION */, radioboxvue_type_template_id_1ec5a25f_hoisted_1)], 2 /* CLASS */)], 2 /* CLASS */), _ctx.show ? (0,external_vue_.renderSlot)(_ctx.$slots, "default", {
|
|
11180
11180
|
key: 0
|
|
11181
11181
|
}, function () {
|
|
11182
11182
|
return [(0,external_vue_.createElementVNode)("span", {
|
|
@@ -11184,7 +11184,7 @@ function radioboxvue_type_template_id_12c1d7f9_render(_ctx, _cache, $props, $set
|
|
|
11184
11184
|
}, (0,external_vue_.toDisplayString)(_ctx.label), 513 /* TEXT, NEED_PATCH */)];
|
|
11185
11185
|
}) : (0,external_vue_.createCommentVNode)("v-if", true)], 2 /* CLASS */);
|
|
11186
11186
|
}
|
|
11187
|
-
;// ./src/components/radioBox/radiobox.vue?vue&type=template&id=
|
|
11187
|
+
;// ./src/components/radioBox/radiobox.vue?vue&type=template&id=1ec5a25f
|
|
11188
11188
|
|
|
11189
11189
|
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[7].use[0]!./src/components/radioBox/radiobox.vue?vue&type=script&lang=js
|
|
11190
11190
|
|
|
@@ -11197,7 +11197,7 @@ var radioboxvue_type_script_lang_js_prefixCls = 'dpzvc3-radiobox';
|
|
|
11197
11197
|
type: [String, Number],
|
|
11198
11198
|
required: true
|
|
11199
11199
|
},
|
|
11200
|
-
|
|
11200
|
+
modelValue: {
|
|
11201
11201
|
type: Boolean,
|
|
11202
11202
|
"default": false
|
|
11203
11203
|
},
|
|
@@ -11206,7 +11206,7 @@ var radioboxvue_type_script_lang_js_prefixCls = 'dpzvc3-radiobox';
|
|
|
11206
11206
|
"default": false
|
|
11207
11207
|
}
|
|
11208
11208
|
},
|
|
11209
|
-
emits: ['update:
|
|
11209
|
+
emits: ['update:modelValue', 'on-change'],
|
|
11210
11210
|
setup: function setup(props, _ref) {
|
|
11211
11211
|
var emit = _ref.emit;
|
|
11212
11212
|
var slotEl = (0,external_vue_.ref)(null);
|
|
@@ -11217,7 +11217,7 @@ var radioboxvue_type_script_lang_js_prefixCls = 'dpzvc3-radiobox';
|
|
|
11217
11217
|
if (group) {
|
|
11218
11218
|
return group.currentValue.value === props.label;
|
|
11219
11219
|
} else {
|
|
11220
|
-
return props.
|
|
11220
|
+
return props.modelValue;
|
|
11221
11221
|
}
|
|
11222
11222
|
});
|
|
11223
11223
|
var classes = (0,external_vue_.computed)(function () {
|
|
@@ -11238,7 +11238,8 @@ var radioboxvue_type_script_lang_js_prefixCls = 'dpzvc3-radiobox';
|
|
|
11238
11238
|
if (group) {
|
|
11239
11239
|
group.change(props.label);
|
|
11240
11240
|
} else {
|
|
11241
|
-
|
|
11241
|
+
// console.log(checked, 'ddadda')
|
|
11242
|
+
emit('update:modelValue', checked);
|
|
11242
11243
|
emit('on-change', checked);
|
|
11243
11244
|
}
|
|
11244
11245
|
}
|
|
@@ -11270,7 +11271,7 @@ var radioboxvue_type_script_lang_js_prefixCls = 'dpzvc3-radiobox';
|
|
|
11270
11271
|
|
|
11271
11272
|
|
|
11272
11273
|
;
|
|
11273
|
-
const radiobox_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(radioboxvue_type_script_lang_js, [['render',
|
|
11274
|
+
const radiobox_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(radioboxvue_type_script_lang_js, [['render',radioboxvue_type_template_id_1ec5a25f_render]])
|
|
11274
11275
|
|
|
11275
11276
|
/* harmony default export */ const radiobox = (radiobox_exports_);
|
|
11276
11277
|
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[7].use[0]!./src/components/radioBox/radiobox-group.vue?vue&type=template&id=d101a504&scoped=true
|
|
@@ -11354,13 +11355,13 @@ const radiobox_group_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(rad
|
|
|
11354
11355
|
|
|
11355
11356
|
radiobox.group = radiobox_group;
|
|
11356
11357
|
/* harmony default export */ const radioBox = (radiobox);
|
|
11357
|
-
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[7].use[0]!./src/components/swipe/swipe.vue?vue&type=template&id=
|
|
11358
|
+
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[7].use[0]!./src/components/swipe/swipe.vue?vue&type=template&id=0053c134
|
|
11358
11359
|
|
|
11359
|
-
var
|
|
11360
|
-
var
|
|
11361
|
-
var
|
|
11362
|
-
var
|
|
11363
|
-
function
|
|
11360
|
+
var swipevue_type_template_id_0053c134_hoisted_1 = ["onClick"];
|
|
11361
|
+
var swipevue_type_template_id_0053c134_hoisted_2 = ["src"];
|
|
11362
|
+
var swipevue_type_template_id_0053c134_hoisted_3 = ["onClick"];
|
|
11363
|
+
var swipevue_type_template_id_0053c134_hoisted_4 = ["src"];
|
|
11364
|
+
function swipevue_type_template_id_0053c134_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11364
11365
|
return (0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", {
|
|
11365
11366
|
ref: "swipeRef",
|
|
11366
11367
|
"class": (0,external_vue_.normalizeClass)(_ctx.classes),
|
|
@@ -11392,8 +11393,8 @@ function swipevue_type_template_id_4bcc6d9d_render(_ctx, _cache, $props, $setup,
|
|
|
11392
11393
|
}, function () {
|
|
11393
11394
|
return [(0,external_vue_.createElementVNode)("img", {
|
|
11394
11395
|
src: _item.image
|
|
11395
|
-
}, null, 8 /* PROPS */,
|
|
11396
|
-
})], 10 /* CLASS, PROPS */,
|
|
11396
|
+
}, null, 8 /* PROPS */, swipevue_type_template_id_0053c134_hoisted_2), (0,external_vue_.createElementVNode)("span", null, (0,external_vue_.toDisplayString)(_item.spec), 1 /* TEXT */)];
|
|
11397
|
+
})], 10 /* CLASS, PROPS */, swipevue_type_template_id_0053c134_hoisted_1);
|
|
11397
11398
|
}), 128 /* KEYED_FRAGMENT */)) : ((0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("a", {
|
|
11398
11399
|
key: 1,
|
|
11399
11400
|
"class": (0,external_vue_.normalizeClass)(_ctx.singleClass),
|
|
@@ -11406,8 +11407,8 @@ function swipevue_type_template_id_4bcc6d9d_render(_ctx, _cache, $props, $setup,
|
|
|
11406
11407
|
}, function () {
|
|
11407
11408
|
return [(0,external_vue_.createElementVNode)("img", {
|
|
11408
11409
|
src: item.image
|
|
11409
|
-
}, null, 8 /* PROPS */,
|
|
11410
|
-
})], 10 /* CLASS, PROPS */,
|
|
11410
|
+
}, null, 8 /* PROPS */, swipevue_type_template_id_0053c134_hoisted_4), (0,external_vue_.createElementVNode)("span", null, (0,external_vue_.toDisplayString)(item.spec), 1 /* TEXT */)];
|
|
11411
|
+
})], 10 /* CLASS, PROPS */, swipevue_type_template_id_0053c134_hoisted_3))], 2 /* CLASS */);
|
|
11411
11412
|
}), 128 /* KEYED_FRAGMENT */)) : (0,external_vue_.createCommentVNode)("v-if", true)], 6 /* CLASS, STYLE */), (0,external_vue_.createCommentVNode)(" :class=\"['dpzvc3-swipe-dots-item', (loop ? index + 1 : index) === slideIndex ? 'active' : '']\" "), (0,external_vue_.createElementVNode)("div", {
|
|
11412
11413
|
"class": (0,external_vue_.normalizeClass)(_ctx.dotsClasses)
|
|
11413
11414
|
}, [((0,external_vue_.openBlock)(true), (0,external_vue_.createElementBlock)(external_vue_.Fragment, null, (0,external_vue_.renderList)(_ctx.dotLength, function (item, index) {
|
|
@@ -11417,7 +11418,7 @@ function swipevue_type_template_id_4bcc6d9d_render(_ctx, _cache, $props, $setup,
|
|
|
11417
11418
|
}, null, 2 /* CLASS */);
|
|
11418
11419
|
}), 128 /* KEYED_FRAGMENT */))], 2 /* CLASS */)], 6 /* CLASS, STYLE */);
|
|
11419
11420
|
}
|
|
11420
|
-
;// ./src/components/swipe/swipe.vue?vue&type=template&id=
|
|
11421
|
+
;// ./src/components/swipe/swipe.vue?vue&type=template&id=0053c134
|
|
11421
11422
|
|
|
11422
11423
|
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[7].use[0]!./src/components/swipe/swipe.vue?vue&type=script&lang=js
|
|
11423
11424
|
|
|
@@ -11636,7 +11637,8 @@ var swipevue_type_script_lang_js_prefixCls = 'dpzvc3-swipe';
|
|
|
11636
11637
|
timer.value = null;
|
|
11637
11638
|
}
|
|
11638
11639
|
function onResize() {
|
|
11639
|
-
if (wrapper.value) clientWidth.value = wrapper.value.clientWidth
|
|
11640
|
+
// if (wrapper.value) clientWidth.value = wrapper.value.clientWidth
|
|
11641
|
+
clientWidth.value = swipeRef.value ? swipeRef.value.clientWidth : 0;
|
|
11640
11642
|
}
|
|
11641
11643
|
(0,external_vue_.onMounted)(function () {
|
|
11642
11644
|
// nextTick(() => {
|
|
@@ -11686,7 +11688,7 @@ var swipevue_type_script_lang_js_prefixCls = 'dpzvc3-swipe';
|
|
|
11686
11688
|
|
|
11687
11689
|
|
|
11688
11690
|
;
|
|
11689
|
-
const swipe_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(swipevue_type_script_lang_js, [['render',
|
|
11691
|
+
const swipe_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(swipevue_type_script_lang_js, [['render',swipevue_type_template_id_0053c134_render]])
|
|
11690
11692
|
|
|
11691
11693
|
/* harmony default export */ const swipe = (swipe_exports_);
|
|
11692
11694
|
;// ./src/components/swipe/index.js
|
|
@@ -12385,13 +12387,13 @@ prompt_confirm.remove = function () {
|
|
|
12385
12387
|
instance.remove();
|
|
12386
12388
|
};
|
|
12387
12389
|
/* harmony default export */ const components_prompt = (prompt_confirm);
|
|
12388
|
-
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[7].use[0]!./src/components/slideBar/slideBar.vue?vue&type=template&id=
|
|
12390
|
+
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[7].use[0]!./src/components/slideBar/slideBar.vue?vue&type=template&id=b7dd0e7a
|
|
12389
12391
|
|
|
12390
|
-
var
|
|
12391
|
-
var
|
|
12392
|
+
var slideBarvue_type_template_id_b7dd0e7a_hoisted_1 = ["onClick"];
|
|
12393
|
+
var slideBarvue_type_template_id_b7dd0e7a_hoisted_2 = {
|
|
12392
12394
|
"class": "content ellipse-fir"
|
|
12393
12395
|
};
|
|
12394
|
-
function
|
|
12396
|
+
function slideBarvue_type_template_id_b7dd0e7a_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
12395
12397
|
return (0,external_vue_.openBlock)(), (0,external_vue_.createElementBlock)("div", {
|
|
12396
12398
|
"class": (0,external_vue_.normalizeClass)(_ctx.classes),
|
|
12397
12399
|
style: (0,external_vue_.normalizeStyle)(_ctx.getStyles)
|
|
@@ -12418,8 +12420,8 @@ function slideBarvue_type_template_id_6ee7198d_render(_ctx, _cache, $props, $set
|
|
|
12418
12420
|
return _ctx.changeBar(key);
|
|
12419
12421
|
}
|
|
12420
12422
|
}, [(0,external_vue_.renderSlot)(_ctx.$slots, 'slide-bar-header-' + key, {}, function () {
|
|
12421
|
-
return [(0,external_vue_.createElementVNode)("a",
|
|
12422
|
-
})], 14 /* CLASS, STYLE, PROPS */,
|
|
12423
|
+
return [(0,external_vue_.createElementVNode)("a", slideBarvue_type_template_id_b7dd0e7a_hoisted_2, (0,external_vue_.toDisplayString)(item.name), 1 /* TEXT */)];
|
|
12424
|
+
})], 14 /* CLASS, STYLE, PROPS */, slideBarvue_type_template_id_b7dd0e7a_hoisted_1);
|
|
12423
12425
|
}), 128 /* KEYED_FRAGMENT */))], 6 /* CLASS, STYLE */), (0,external_vue_.createElementVNode)("div", {
|
|
12424
12426
|
"class": (0,external_vue_.normalizeClass)(_ctx.absoluteClass),
|
|
12425
12427
|
style: (0,external_vue_.normalizeStyle)(_ctx.getScrollStyle)
|
|
@@ -12442,7 +12444,7 @@ function slideBarvue_type_template_id_6ee7198d_render(_ctx, _cache, $props, $set
|
|
|
12442
12444
|
}, [(0,external_vue_.renderSlot)(_ctx.$slots, 'slot-item-' + index)], 6 /* CLASS, STYLE */);
|
|
12443
12445
|
}), 128 /* KEYED_FRAGMENT */))], 6 /* CLASS, STYLE */)], 6 /* CLASS, STYLE */)], 6 /* CLASS, STYLE */);
|
|
12444
12446
|
}
|
|
12445
|
-
;// ./src/components/slideBar/slideBar.vue?vue&type=template&id=
|
|
12447
|
+
;// ./src/components/slideBar/slideBar.vue?vue&type=template&id=b7dd0e7a
|
|
12446
12448
|
|
|
12447
12449
|
;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[7].use[0]!./src/components/slideBar/slideBar.vue?vue&type=script&lang=js
|
|
12448
12450
|
|
|
@@ -12531,9 +12533,8 @@ var slideBarvue_type_script_lang_js_prefixCls = 'dpzvc3-slideBar';
|
|
|
12531
12533
|
var getItemWidth = (0,external_vue_.computed)(function () {
|
|
12532
12534
|
return isFlex.value ? clientWidth.value / items.value.length : props.childWidth;
|
|
12533
12535
|
});
|
|
12534
|
-
|
|
12535
|
-
|
|
12536
|
-
});
|
|
12536
|
+
// const translateX = computed(() => -startIndex.value * clientWidth.value)
|
|
12537
|
+
var translateX = (0,external_vue_.ref)(0);
|
|
12537
12538
|
var classes = (0,external_vue_.computed)(function () {
|
|
12538
12539
|
return [slideBarvue_type_script_lang_js_prefixCls];
|
|
12539
12540
|
});
|
|
@@ -12581,6 +12582,7 @@ var slideBarvue_type_script_lang_js_prefixCls = 'dpzvc3-slideBar';
|
|
|
12581
12582
|
function changeBar(index) {
|
|
12582
12583
|
if (startIndex.value === index) return;
|
|
12583
12584
|
startIndex.value = index;
|
|
12585
|
+
translateX.value = -startIndex.value * clientWidth.value;
|
|
12584
12586
|
emit('on-change', index);
|
|
12585
12587
|
}
|
|
12586
12588
|
|
|
@@ -12594,21 +12596,35 @@ var slideBarvue_type_script_lang_js_prefixCls = 'dpzvc3-slideBar';
|
|
|
12594
12596
|
function onTouchMove(e) {
|
|
12595
12597
|
var currentX = e.touches[0].clientX;
|
|
12596
12598
|
distance.value = props.distanceIndex ? (currentX - startX.value) / props.distanceIndex : currentX - startX.value;
|
|
12599
|
+
translateX.value = startTranslateX.value + distance.value;
|
|
12597
12600
|
}
|
|
12598
12601
|
function onTouchEnd() {
|
|
12599
12602
|
if (distance.value < 0 && Math.abs(distance.value) > clientWidth.value / 2) {
|
|
12600
12603
|
slideLeft();
|
|
12601
12604
|
} else if (distance.value > 0 && Math.abs(distance.value) > clientWidth.value / 2) {
|
|
12602
12605
|
slideRight();
|
|
12606
|
+
} else {
|
|
12607
|
+
translateX.value = startTranslateX.value;
|
|
12603
12608
|
}
|
|
12604
12609
|
dragging.value = false;
|
|
12605
12610
|
}
|
|
12606
12611
|
function slideLeft() {
|
|
12607
|
-
if (startIndex.value
|
|
12612
|
+
if (startIndex.value >= maxIndex.value) {
|
|
12613
|
+
translateX.value = startTranslateX.value;
|
|
12614
|
+
} else {
|
|
12615
|
+
startIndex.value++;
|
|
12616
|
+
translateX.value = startTranslateX.value - clientWidth.value;
|
|
12617
|
+
}
|
|
12608
12618
|
emit('on-change', startIndex.value);
|
|
12609
12619
|
}
|
|
12610
12620
|
function slideRight() {
|
|
12611
|
-
if (startIndex.value > 0) startIndex.value
|
|
12621
|
+
// if (startIndex.value > 0) startIndex.value--
|
|
12622
|
+
if (startIndex.value <= 0) {
|
|
12623
|
+
translateX.value = startTranslateX.value;
|
|
12624
|
+
} else {
|
|
12625
|
+
startIndex.value--;
|
|
12626
|
+
translateX.value = startTranslateX.value + clientWidth.value;
|
|
12627
|
+
}
|
|
12612
12628
|
emit('on-change', startIndex.value);
|
|
12613
12629
|
}
|
|
12614
12630
|
|
|
@@ -12621,8 +12637,11 @@ var slideBarvue_type_script_lang_js_prefixCls = 'dpzvc3-slideBar';
|
|
|
12621
12637
|
}
|
|
12622
12638
|
(0,external_vue_.onMounted)(function () {
|
|
12623
12639
|
clientWidth.value = header.value.clientWidth;
|
|
12640
|
+
translateX.value = -startIndex.value * clientWidth.value;
|
|
12624
12641
|
window.addEventListener('resize', onResize);
|
|
12642
|
+
onScroll();
|
|
12625
12643
|
if (props.canDrag && content.value) {
|
|
12644
|
+
// console.log(content.value, 'dadsds')
|
|
12626
12645
|
content.value.addEventListener('touchstart', onTouchStart);
|
|
12627
12646
|
content.value.addEventListener('touchmove', onTouchMove);
|
|
12628
12647
|
content.value.addEventListener('touchend', onTouchEnd);
|
|
@@ -12669,7 +12688,7 @@ var slideBarvue_type_script_lang_js_prefixCls = 'dpzvc3-slideBar';
|
|
|
12669
12688
|
|
|
12670
12689
|
|
|
12671
12690
|
;
|
|
12672
|
-
const slideBar_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(slideBarvue_type_script_lang_js, [['render',
|
|
12691
|
+
const slideBar_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(slideBarvue_type_script_lang_js, [['render',slideBarvue_type_template_id_b7dd0e7a_render]])
|
|
12673
12692
|
|
|
12674
12693
|
/* harmony default export */ const slideBar = (slideBar_exports_);
|
|
12675
12694
|
;// ./src/components/slideBar/index.js
|