ai.touchui-vue 1.40.0 → 1.40.2
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/lib/ai.touchui-vue.common.js +78 -46
- package/lib/index.js +1 -1
- package/lib/slide.js +72 -40
- package/package.json +1 -1
- package/packages/slide/src/slide.vue +50 -25
- package/src/index.js +1 -1
|
@@ -46622,8 +46622,8 @@ guider.install = function (Vue) {
|
|
|
46622
46622
|
};
|
|
46623
46623
|
|
|
46624
46624
|
/* harmony default export */ var packages_guider = (guider);
|
|
46625
|
-
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/slide/src/slide.vue?vue&type=template&id=
|
|
46626
|
-
var
|
|
46625
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/slide/src/slide.vue?vue&type=template&id=0f2000b8
|
|
46626
|
+
var slidevue_type_template_id_0f2000b8_render = function () {
|
|
46627
46627
|
var _vm = this
|
|
46628
46628
|
var _h = _vm.$createElement
|
|
46629
46629
|
var _c = _vm._self._c || _h
|
|
@@ -46693,11 +46693,11 @@ var slidevue_type_template_id_020258e2_render = function () {
|
|
|
46693
46693
|
]
|
|
46694
46694
|
)
|
|
46695
46695
|
}
|
|
46696
|
-
var
|
|
46697
|
-
|
|
46696
|
+
var slidevue_type_template_id_0f2000b8_staticRenderFns = []
|
|
46697
|
+
slidevue_type_template_id_0f2000b8_render._withStripped = true
|
|
46698
46698
|
|
|
46699
46699
|
|
|
46700
|
-
// CONCATENATED MODULE: ./packages/slide/src/slide.vue?vue&type=template&id=
|
|
46700
|
+
// CONCATENATED MODULE: ./packages/slide/src/slide.vue?vue&type=template&id=0f2000b8
|
|
46701
46701
|
|
|
46702
46702
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/slide/src/slide.vue?vue&type=script&lang=js
|
|
46703
46703
|
//
|
|
@@ -46719,6 +46719,31 @@ slidevue_type_template_id_020258e2_render._withStripped = true
|
|
|
46719
46719
|
//
|
|
46720
46720
|
//
|
|
46721
46721
|
|
|
46722
|
+
function slidevue_type_script_lang_js_db(fn) {
|
|
46723
|
+
var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 50;
|
|
46724
|
+
|
|
46725
|
+
// 通过闭包缓存一个定时器 id
|
|
46726
|
+
var timer = null;
|
|
46727
|
+
// 将 debounce 处理结果当作函数返回
|
|
46728
|
+
// 触发事件回调时执行这个返回函数
|
|
46729
|
+
return function () {
|
|
46730
|
+
var _this = this;
|
|
46731
|
+
|
|
46732
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
46733
|
+
args[_key] = arguments[_key];
|
|
46734
|
+
}
|
|
46735
|
+
|
|
46736
|
+
// 如果已经设定过定时器就清空上一次的定时器
|
|
46737
|
+
if (timer) clearTimeout(timer);
|
|
46738
|
+
// 开始设定一个新的定时器,定时器结束后执行传入的函数 fn
|
|
46739
|
+
timer = setTimeout(function () {
|
|
46740
|
+
fn.apply(_this, args);
|
|
46741
|
+
|
|
46742
|
+
clearTimeout(timer);
|
|
46743
|
+
timer = null;
|
|
46744
|
+
}, wait);
|
|
46745
|
+
};
|
|
46746
|
+
}
|
|
46722
46747
|
/* harmony default export */ var slidevue_type_script_lang_js = ({
|
|
46723
46748
|
name: 'ToSlide',
|
|
46724
46749
|
componentName: 'ToSlide',
|
|
@@ -46757,91 +46782,98 @@ slidevue_type_template_id_020258e2_render._withStripped = true
|
|
|
46757
46782
|
}
|
|
46758
46783
|
},
|
|
46759
46784
|
mounted: function mounted() {
|
|
46760
|
-
var
|
|
46785
|
+
var _this2 = this;
|
|
46761
46786
|
|
|
46762
|
-
|
|
46763
|
-
|
|
46764
|
-
|
|
46765
|
-
|
|
46766
|
-
_this.$refs.firstFake.innerHTML = _this.$refs.ul.querySelector(':nth-child(' + (_this.length + 1) + ')').innerHTML;
|
|
46767
|
-
_this.play();
|
|
46768
|
-
window.addEventListener('resize', function () {
|
|
46769
|
-
_this.width = _this.$el.offsetWidth;
|
|
46770
|
-
});
|
|
46787
|
+
this.setLength();
|
|
46788
|
+
this.$refs.lastFake.innerHTML = this.$refs.ul.querySelector(':nth-child(2)').innerHTML;
|
|
46789
|
+
this.$refs.firstFake.innerHTML = this.$refs.ul.querySelector(':nth-child(' + (this.length + 1) + ')').innerHTML;
|
|
46790
|
+
this.play();
|
|
46771
46791
|
|
|
46772
|
-
|
|
46773
|
-
|
|
46774
|
-
|
|
46775
|
-
|
|
46776
|
-
|
|
46777
|
-
|
|
46778
|
-
|
|
46779
|
-
|
|
46780
|
-
|
|
46781
|
-
}
|
|
46792
|
+
window.addEventListener('resize', this.setWidth);
|
|
46793
|
+
|
|
46794
|
+
// 初始化 MutationObserver
|
|
46795
|
+
var observer = new MutationObserver(function (mutations) {
|
|
46796
|
+
_this2.setLength(); // 每次子节点变化时更新长度
|
|
46797
|
+
});
|
|
46798
|
+
observer.observe(this.$refs.ul, {
|
|
46799
|
+
childList: true, // 监听子节点变化
|
|
46800
|
+
subtree: true // 监听所有后代节点
|
|
46801
|
+
});
|
|
46802
|
+
this.observer = observer;
|
|
46803
|
+
|
|
46804
|
+
var mo = new MutationObserver(function (mutations) {
|
|
46805
|
+
_this2.width = _this2.$el.offsetWidth;
|
|
46806
|
+
});
|
|
46807
|
+
mo.observe(document.documentElement, {
|
|
46808
|
+
attributes: true,
|
|
46809
|
+
attributeFilter: ['style']
|
|
46810
|
+
});
|
|
46782
46811
|
},
|
|
46783
46812
|
beforeDestroy: function beforeDestroy() {
|
|
46784
|
-
var _this2 = this;
|
|
46785
|
-
|
|
46786
46813
|
if (this.observer) {
|
|
46787
46814
|
this.observer.disconnect(); // 断开监听
|
|
46788
46815
|
}
|
|
46789
46816
|
clearInterval(this.playTimer); // 清理定时器
|
|
46790
|
-
window.removeEventListener('resize',
|
|
46791
|
-
_this2.width = _this2.$el.offsetWidth;
|
|
46792
|
-
});
|
|
46817
|
+
window.removeEventListener('resize', this.setWidth);
|
|
46793
46818
|
},
|
|
46794
46819
|
|
|
46795
46820
|
methods: {
|
|
46796
|
-
|
|
46821
|
+
setWidth: function setWidth() {
|
|
46797
46822
|
var _this3 = this;
|
|
46798
46823
|
|
|
46824
|
+
slidevue_type_script_lang_js_db(function () {
|
|
46825
|
+
_this3.width = _this3.$el.offsetWidth;
|
|
46826
|
+
}, 200)();
|
|
46827
|
+
},
|
|
46828
|
+
play: function play() {
|
|
46829
|
+
var _this4 = this;
|
|
46830
|
+
|
|
46799
46831
|
if (!this.autoplay || this.length < 2) {
|
|
46800
46832
|
return;
|
|
46801
46833
|
}
|
|
46802
46834
|
this.playTimer = setInterval(function () {
|
|
46803
|
-
|
|
46835
|
+
_this4.next();
|
|
46804
46836
|
}, Number(this.speed));
|
|
46805
46837
|
},
|
|
46806
46838
|
pause: function pause() {
|
|
46807
46839
|
clearInterval(this.playTimer);
|
|
46808
46840
|
},
|
|
46809
46841
|
setLength: function setLength() {
|
|
46810
|
-
var
|
|
46842
|
+
var _this5 = this;
|
|
46811
46843
|
|
|
46812
46844
|
this.$nextTick(function () {
|
|
46813
|
-
if (
|
|
46814
|
-
|
|
46845
|
+
if (_this5.$refs.ul) {
|
|
46846
|
+
_this5.length = _this5.$refs.ul.children.length - 2;
|
|
46815
46847
|
}
|
|
46816
46848
|
});
|
|
46817
46849
|
},
|
|
46818
46850
|
next: function next() {
|
|
46819
|
-
var
|
|
46851
|
+
var _this6 = this;
|
|
46820
46852
|
|
|
46821
46853
|
if (this.animate) {
|
|
46822
46854
|
this.current += 1;
|
|
46823
46855
|
if (this.current === this.length) {
|
|
46824
46856
|
setTimeout(function () {
|
|
46825
|
-
|
|
46826
|
-
|
|
46857
|
+
_this6.animate = false;
|
|
46858
|
+
_this6.current = 0;
|
|
46827
46859
|
setTimeout(function () {
|
|
46828
|
-
|
|
46860
|
+
_this6.animate = true;
|
|
46829
46861
|
}, 300);
|
|
46830
46862
|
}, 300);
|
|
46831
46863
|
}
|
|
46832
46864
|
}
|
|
46833
46865
|
},
|
|
46834
46866
|
prev: function prev() {
|
|
46835
|
-
var
|
|
46867
|
+
var _this7 = this;
|
|
46836
46868
|
|
|
46837
46869
|
if (this.animate) {
|
|
46838
46870
|
this.current -= 1;
|
|
46839
46871
|
if (this.current === -1) {
|
|
46840
46872
|
setTimeout(function () {
|
|
46841
|
-
|
|
46842
|
-
|
|
46873
|
+
_this7.animate = false;
|
|
46874
|
+
_this7.current = _this7.length - 1;
|
|
46843
46875
|
setTimeout(function () {
|
|
46844
|
-
|
|
46876
|
+
_this7.animate = true;
|
|
46845
46877
|
}, 300);
|
|
46846
46878
|
}, 300);
|
|
46847
46879
|
}
|
|
@@ -46896,8 +46928,8 @@ slidevue_type_template_id_020258e2_render._withStripped = true
|
|
|
46896
46928
|
|
|
46897
46929
|
var slide_component = normalizeComponent(
|
|
46898
46930
|
src_slidevue_type_script_lang_js,
|
|
46899
|
-
|
|
46900
|
-
|
|
46931
|
+
slidevue_type_template_id_0f2000b8_render,
|
|
46932
|
+
slidevue_type_template_id_0f2000b8_staticRenderFns,
|
|
46901
46933
|
false,
|
|
46902
46934
|
null,
|
|
46903
46935
|
null,
|
|
@@ -50259,7 +50291,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
50259
50291
|
}
|
|
50260
50292
|
|
|
50261
50293
|
/* harmony default export */ var src = __webpack_exports__["default"] = ({
|
|
50262
|
-
version: '1.40.
|
|
50294
|
+
version: '1.40.2',
|
|
50263
50295
|
locale: lib_locale_default.a.use,
|
|
50264
50296
|
i18n: lib_locale_default.a.i18n,
|
|
50265
50297
|
install: src_install,
|