How to use the iview/src/utils/assist.getStyle function in iview

To help you get started, we’ve selected a few iview examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hunzhiwange / queryphp / frontend / src / components / iview / table / table.vue View on Github external
this.$nextTick(() => {
                    const allWidth = !this.columns.some(cell => !cell.width);    // each column set a width
                    if (allWidth) {
                        this.tableWidth = this.columns.map(cell => cell.width).reduce((a, b) => a + b);

                    } else {
                        this.tableWidth = parseInt(getStyle(this.$el, 'width')) - 1;
                    }
                    this.columnsWidth = {};
                    this.$nextTick(() => {
                        let columnsWidth = {};
                        let fixedLeftwidth = 0;
                        let fixedRightwidth = this.bodyRealHeight>this.bodyHeight?this.scrollBarWidth:0;
                        const $td =  this.data.length>0?this.$refs.tbody.$el.querySelectorAll('tbody tr')[0].querySelectorAll('td'):this.$refs.header.querySelectorAll('thead tr')[0].querySelectorAll('th');
                        for (let i = 0; i < $td.length; i++) {    // can not use forEach in Firefox
                            const column = this.cloneColumns[i];
                            let width = parseInt(getStyle($td[i], 'width'));
                            if (column.fixed && column.fixed === 'left') {
                                fixedLeftwidth += width;
                            }
                            if (column.fixed && column.fixed === 'right') {
                                fixedRightwidth += width;
                            }
github hunzhiwange / queryphp / frontend / src / components / iview / table / table.vue View on Github external
if (column.width) {
                                width = column.width;
                            }
                            this.cloneColumns[i]._width = width;
                            // this.cloneColumns[i].width = width;
                            columnsWidth[column._index] = {
                                width: width
                            };
                        }
                        this.columnsWidth = columnsWidth;
                        //change fixed style
                        if (fixedLeftwidth>0) this.fixedTableStyle.width = `${fixedLeftwidth}px`;
                        if (fixedRightwidth>0) this.fixedRightTableStyle.width = `${fixedRightwidth}px`;
                    });
                    // get table real height,for fixed when set height prop,but height < table's height,show scrollBarWidth
                    this.bodyRealHeight = parseInt(getStyle(this.$refs.tbody.$el, 'height'));
                });
            },
github hunzhiwange / queryphp / frontend / src / components / iview / table / table.vue View on Github external
this.$nextTick(() => {
                        let columnsWidth = {};
                        let fixedLeftwidth = 0;
                        let fixedRightwidth = this.bodyRealHeight>this.bodyHeight?this.scrollBarWidth:0;
                        const $td =  this.data.length>0?this.$refs.tbody.$el.querySelectorAll('tbody tr')[0].querySelectorAll('td'):this.$refs.header.querySelectorAll('thead tr')[0].querySelectorAll('th');
                        for (let i = 0; i < $td.length; i++) {    // can not use forEach in Firefox
                            const column = this.cloneColumns[i];
                            let width = parseInt(getStyle($td[i], 'width'));
                            if (column.fixed && column.fixed === 'left') {
                                fixedLeftwidth += width;
                            }
                            if (column.fixed && column.fixed === 'right') {
                                fixedRightwidth += width;
                            }
                            if (column.width) {
                                width = column.width;
                            }
                            this.cloneColumns[i]._width = width;
                            // this.cloneColumns[i].width = width;
                            columnsWidth[column._index] = {
                                width: width
                            };
                        }
                        this.columnsWidth = columnsWidth;
github hunzhiwange / queryphp / frontend / src / components / iview / table / table.vue View on Github external
this.$nextTick(() => {
                        const titleHeight = parseInt(getStyle(this.$refs.title, 'height')) || 0;
                        const headerHeight = parseInt(getStyle(this.$refs.header, 'height')) || 0;
                        const footerHeight = parseInt(getStyle(this.$refs.footer, 'height')) || 0;
                        this.bodyHeight = this.height - titleHeight - headerHeight - footerHeight;
                    });
                } else {
github hunzhiwange / queryphp / frontend / src / components / iview / table / table.vue View on Github external
this.$nextTick(() => {
                        const titleHeight = parseInt(getStyle(this.$refs.title, 'height')) || 0;
                        const headerHeight = parseInt(getStyle(this.$refs.header, 'height')) || 0;
                        const footerHeight = parseInt(getStyle(this.$refs.footer, 'height')) || 0;
                        this.bodyHeight = this.height - titleHeight - headerHeight - footerHeight;
                    });
                } else {
github hunzhiwange / queryphp / frontend / src / components / iview / table / table.vue View on Github external
this.$nextTick(() => {
                        const titleHeight = parseInt(getStyle(this.$refs.title, 'height')) || 0;
                        const headerHeight = parseInt(getStyle(this.$refs.header, 'height')) || 0;
                        const footerHeight = parseInt(getStyle(this.$refs.footer, 'height')) || 0;
                        this.bodyHeight = this.height - titleHeight - headerHeight - footerHeight;
                    });
                } else {