Skip to content

Commit

Permalink
update dist and lib
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaming743 committed Aug 19, 2020
1 parent e67b4d5 commit 1082be1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
22 changes: 16 additions & 6 deletions dist/datav.map.vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -23018,7 +23018,8 @@
aligns: [],
animationIndex: 0,
animationHandler: '',
updater: 0
updater: 0,
needCalc: false
};
},

Expand Down Expand Up @@ -23208,6 +23209,18 @@
},

async animation(start = false) {
const {
needCalc,
calcHeights,
calcRowsData
} = this;

if (needCalc) {
calcRowsData();
calcHeights();
this.needCalc = false;
}

let {
avgHeight,
animationIndex,
Expand Down Expand Up @@ -23270,16 +23283,13 @@
updateRows(rows, animationIndex) {
const {
mergedConfig,
calcRowsData,
calcHeights,
animationHandler,
animation
} = this;
this.mergedConfig = { ...mergedConfig,
data: [...rows]
};
calcRowsData();
calcHeights();
this.needCalc = true;
if (typeof animationIndex === 'number') this.animationIndex = animationIndex;
if (!animationHandler) animation(true);
}
Expand Down Expand Up @@ -23393,7 +23403,7 @@
/* style */
const __vue_inject_styles__$z = function (inject) {
if (!inject) return
inject("data-v-58d7aca1_0", { source: ".dv-scroll-board {\n position: relative;\n width: 100%;\n height: 100%;\n color: #fff;\n}\n.dv-scroll-board .text {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .header {\n display: flex;\n flex-direction: row;\n font-size: 15px;\n}\n.dv-scroll-board .header .header-item {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows {\n overflow: hidden;\n}\n.dv-scroll-board .rows .row-item {\n display: flex;\n font-size: 14px;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows .ceil {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .rows .index {\n border-radius: 3px;\n padding: 0px 3px;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,WAAW;AACb;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;AACA;EACE,aAAa;EACb,mBAAmB;EACnB,eAAe;AACjB;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;EACvB,oBAAoB;AACtB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,aAAa;EACb,eAAe;EACf,oBAAoB;AACtB;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;AACA;EACE,kBAAkB;EAClB,gBAAgB;AAClB","file":"main.vue","sourcesContent":[".dv-scroll-board {\n position: relative;\n width: 100%;\n height: 100%;\n color: #fff;\n}\n.dv-scroll-board .text {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .header {\n display: flex;\n flex-direction: row;\n font-size: 15px;\n}\n.dv-scroll-board .header .header-item {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows {\n overflow: hidden;\n}\n.dv-scroll-board .rows .row-item {\n display: flex;\n font-size: 14px;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows .ceil {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .rows .index {\n border-radius: 3px;\n padding: 0px 3px;\n}\n"]}, media: undefined });
inject("data-v-26e19f4c_0", { source: ".dv-scroll-board {\n position: relative;\n width: 100%;\n height: 100%;\n color: #fff;\n}\n.dv-scroll-board .text {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .header {\n display: flex;\n flex-direction: row;\n font-size: 15px;\n}\n.dv-scroll-board .header .header-item {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows {\n overflow: hidden;\n}\n.dv-scroll-board .rows .row-item {\n display: flex;\n font-size: 14px;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows .ceil {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .rows .index {\n border-radius: 3px;\n padding: 0px 3px;\n}\n", map: {"version":3,"sources":["main.vue"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,WAAW;AACb;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;AACA;EACE,aAAa;EACb,mBAAmB;EACnB,eAAe;AACjB;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;EACvB,oBAAoB;AACtB;AACA;EACE,gBAAgB;AAClB;AACA;EACE,aAAa;EACb,eAAe;EACf,oBAAoB;AACtB;AACA;EACE,eAAe;EACf,sBAAsB;EACtB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;AACA;EACE,kBAAkB;EAClB,gBAAgB;AAClB","file":"main.vue","sourcesContent":[".dv-scroll-board {\n position: relative;\n width: 100%;\n height: 100%;\n color: #fff;\n}\n.dv-scroll-board .text {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .header {\n display: flex;\n flex-direction: row;\n font-size: 15px;\n}\n.dv-scroll-board .header .header-item {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows {\n overflow: hidden;\n}\n.dv-scroll-board .rows .row-item {\n display: flex;\n font-size: 14px;\n transition: all 0.3s;\n}\n.dv-scroll-board .rows .ceil {\n padding: 0 10px;\n box-sizing: border-box;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dv-scroll-board .rows .index {\n border-radius: 3px;\n padding: 0px 3px;\n}\n"]}, media: undefined });

};
/* scoped */
Expand Down
2 changes: 1 addition & 1 deletion dist/datav.min.vue.js

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions lib/components/scrollBoard/src/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ export default {
animationHandler: '',
updater: 0
updater: 0,
needCalc: false
}
},
watch: {
Expand Down Expand Up @@ -335,6 +337,14 @@ export default {
this.aligns = deepMerge(aligns, align)
},
async animation (start = false) {
const { needCalc, calcHeights, calcRowsData } = this
if (needCalc) {
calcRowsData()
calcHeights()
this.needCalc = false
}
let { avgHeight, animationIndex, mergedConfig, rowsData, animation, updater } = this
const { waitTime, carousel, rowNum } = mergedConfig
Expand Down Expand Up @@ -389,15 +399,15 @@ export default {
})
},
updateRows(rows, animationIndex) {
const { mergedConfig, calcRowsData, calcHeights, animationHandler, animation } = this
const { mergedConfig, animationHandler, animation } = this
this.mergedConfig = {
...mergedConfig,
data: [...rows]
}
calcRowsData()
calcHeights()
this.needCalc = true
if (typeof animationIndex === 'number') this.animationIndex = animationIndex
if (!animationHandler) animation(true)
}
Expand Down

0 comments on commit 1082be1

Please sign in to comment.