溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Vue標(biāo)尺插件如何使用

發(fā)布時間:2022-02-28 09:13:55 來源:億速云 閱讀:328 作者:iii 欄目:開發(fā)技術(shù)

本篇內(nèi)容主要講解“Vue標(biāo)尺插件如何使用”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學(xué)習(xí)“Vue標(biāo)尺插件如何使用”吧!

可根據(jù)高和寬度自適應(yīng),主要傳值為寬度和距離零刻度的距離,代碼和圖片如下。

Vue標(biāo)尺插件如何使用

Vue標(biāo)尺插件如何使用

<template>
    <div class="demoRule">
        <el-row class=" main">
            <div class="rightBorder" v-if="duiData&&duiData.length>0"></div>
            <div class="ruleF" v-for="(item,indexDui) in duiData" :key="indexDui" :>
                <div class="content" :>
                    <div class="faRe" v-for="(itemF,indexF) in item.faReData" :key="indexF" :> (發(fā)熱)</div>
                    <div class="boxes" v-for="(itemDuo,indexDuo) in item.duoData" :key="indexDuo" :>{{itemDuo.content}} </div>
                </div>
                <div v-for="(itemNum, indexNum) in 24 " :key="indexNum" class="ruleBody" :>
                    <div class="num" v-if="indexDui%2==0">{{itemNum*50}}</div>
                </div>
            </div>
        </el-row>
    </div>
</template>
<script>

export default {
    data () {
        return {
            colorData: {
                1: "#aad494",
                2: "#aab6dc",
                3: "#faf5b3",
                4: "#c5acd3",
                5: "#faa5a5",
                6: "#faacc4",
            },
            duiData: [
                {
                    duoData: [
                        {
                            width: "5%",
                            right: "0%",
                            color: "1",
                            content: "爽膚水",
                        },
                        {
                            width: "8%",
                            right: "26%",
                            color: "2",
                            content: "康師傅",
                        }, {
                            width: "6%",
                            right: "75%",
                            color: "3",
                            content: "電風(fēng)扇",
                        }
                    ],
                    faReData: [
                        { right: "3%", },
                        { right: "36%", },
                        { right: "86%", }
                    ],
                },
                {
                    duoData: [
                        {
                            width: "3%",
                            right: "25%",
                            color: "4",
                            content: "娃哈哈",
                        },
                        {
                            width: "7%",
                            right: "56%",
                            color: "5",
                            content: "集裝箱",
                        }, {
                            width: "7%",
                            right: "85%",
                            color: "6",
                            content: "意大利炮",
                        }
                    ],
                    faReData: [
                        { right: "5%", },
                        { right: "66%", },
                        { right: "76%", }
                    ],
                },
                {
                    duoData: [
                        {
                            width: "5%",
                            right: "5%",
                            color: "1",
                            content: "爽膚水",
                        },
                        {
                            width: "8%",
                            right: "26%",
                            color: "2",
                            content: "康師傅",
                        }, {
                            width: "6%",
                            right: "75%",
                            color: "3",
                            content: "電風(fēng)扇",
                        }
                    ],
                    faReData: [
                        { right: "3%", },
                        { right: "36%", },
                        { right: "86%", }
                    ],
                },
                {
                    duoData: [
                        {
                            width: "3%",
                            right: "25%",
                            color: "4",
                            content: "娃哈哈",
                        },
                        {
                            width: "7%",
                            right: "56%",
                            color: "5",
                            content: "集裝箱",
                        }, {
                            width: "7%",
                            right: "85%",
                            color: "6",
                            content: "意大利炮",
                        }
                    ],
                    faReData: [
                        { right: "5%", },
                        { right: "66%", },
                        { right: "76%", }
                    ],
                },
                {
                    duoData: [
                        {
                            width: "5%",
                            right: "5%",
                            color: "1",
                            content: "爽膚水",
                        },
                        {
                            width: "8%",
                            right: "26%",
                            color: "2",
                            content: "康師傅",
                        }, {
                            width: "6%",
                            right: "75%",
                            color: "3",
                            content: "電風(fēng)扇",
                        }
                    ],
                    faReData: [
                        { right: "3%", },
                        { right: "36%", },
                        { right: "86%", }
                    ],
                },
                {
                    duoData: [
                        {
                            width: "3%",
                            right: "25%",
                            color: "4",
                            content: "娃哈哈",
                        },
                        {
                            width: "7%",
                            right: "56%",
                            color: "5",
                            content: "集裝箱",
                        }, {
                            width: "7%",
                            right: "85%",
                            color: "6",
                            content: "意大利炮",
                        }
                    ],
                    faReData: [
                        { right: "5%", },
                        { right: "66%", },
                        { right: "76%", }
                    ],
                },
                {
                    duoData: [
                        {
                            width: "5%",
                            right: "5%",
                            color: "1",
                            content: "爽膚水",
                        },
                        {
                            width: "8%",
                            right: "26%",
                            color: "2",
                            content: "康師傅",
                        }, {
                            width: "6%",
                            right: "75%",
                            color: "3",
                            content: "電風(fēng)扇",
                        }
                    ],
                    faReData: [
                        { right: "3%", },
                        { right: "36%", },
                        { right: "86%", }
                    ],
                },
                {
                    duoData: [
                        {
                            width: "3%",
                            right: "25%",
                            color: "4",
                            content: "娃哈哈",
                        },
                        {
                            width: "7%",
                            right: "56%",
                            color: "5",
                            content: "集裝箱",
                        }, {
                            width: "7%",
                            right: "85%",
                            color: "6",
                            content: "意大利炮",
                        }
                    ],
                    faReData: [
                        { right: "5%", },
                        { right: "66%", },
                        { right: "76%", }
                    ],
                },
            ],

        };
    },
    watch: {},
    created () {

    },
    mounted () {
        // ruleF    
    },
    methods: {}
};
</script>
<style lang="scss" scoped>
.demoRule {
    width: calc(100% - 30px);
    height: calc(100vh - 131px);
    background: #f3f3f3;
    padding: 15px;
}
.main {
    width: 95%;
    height: 95%;
    margin: 0px auto;
    margin-top: 1%;
    padding: 10px;
    border: 1px solid #eaeaea;
    position: relative;
    // background: white;
}
.rightBorder {
    position: absolute;
    width: 1.5px;
    height: calc(100% - 20px);
    background: #c3c3c3;
    top: 10px;
    right: calc(2% + 7px);
    z-index: 100;
}

.ruleF {
    width: 100%;
    font-size: 12px;
    color: #909399;
}
.content {
    overflow: hidden;
    position: relative;
    width: 96%;
    margin-left: 2%;
    height: calc(100% - 30px);
    border-left: 1.5px solid #777777;
    background: #ffffff;
    // border-right: 1.5px solid #777777;
}
.faRe {
    z-index: 101;
    position: absolute;
    color: red;
    top: 5px;
}
.boxes {
    z-index: 1;
    height: 100%;
    position: absolute;
    top: 0px;
    color: #0a2731;
    justify-content: center;
    align-items: center;
    text-align: center;
    display: flex;
    font-weight: bold;
}
.ruleBody {
    width: 4%;
    height: 30px;
    background: url("../../assets/images/rule.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    float: right;
}
.num {
    position: relative;
    margin-left: -10px;
    z-index: 100;
    margin-top: 13px;
}
</style>

到此,相信大家對“Vue標(biāo)尺插件如何使用”有了更深的了解,不妨來實際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進入相關(guān)頻道進行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

vue
AI