最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue樹形控件tree的使用方法

 更新時(shí)間:2022年03月30日 09:23:51   作者:牽手北京99  
這篇文章主要為大家詳細(xì)介紹了vue樹形控件tree的使用方法,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了vue樹形控件tree使用的具體代碼,供大家參考,具體內(nèi)容如下

<template>
? <div class="hello tree-container">
? ? <el-tree
? ? ? :data="data"
? ? ? show-checkbox
? ? ? node-key="id"
? ? ? class="tree"
? ? ? :allow-drop="allowDrop"
? ? ? :props="defaultProps"
? ? ? :default-expanded-keys="[2, 3]"
? ? ? :default-checked-keys="[5]">
? ? </el-tree>
? </div>
</template>
<script>
export default {
? name: 'HelloWorld',
? data () {
? ? return {
? ? ? msg: 'Welcome to Your Vue.js App|',
? ? ? data: [{
? ? ? ? ? id: 1,
? ? ? ? ? label: '一級 2',
? ? ? ? ? children: [{
? ? ? ? ? ? id: 3,
? ? ? ? ? ? label: '二級 2-1',
? ? ? ? ? ? children: [{
? ? ? ? ? ? ? id: 4,
? ? ? ? ? ? ? label: '三級 3-1-1'
? ? ? ? ? ? }, {
? ? ? ? ? ? ? id: 5,
? ? ? ? ? ? ? label: '三級 3-1-2',
? ? ? ? ? ? ? disabled: true
? ? ? ? ? ? }]
? ? ? ? ? }, {
? ? ? ? ? ? id: 2,
? ? ? ? ? ? label: '二級 2-2',
? ? ? ? ? ? disabled: true,
? ? ? ? ? ? children: [{
? ? ? ? ? ? ? id: 6,
? ? ? ? ? ? ? label: '三級 3-2-1'
? ? ? ? ? ? }, {
? ? ? ? ? ? ? id: 7,
? ? ? ? ? ? ? label: '三級 3-2-2',
? ? ? ? ? ? ? disabled: true,
? ? ? ? ? ? ? children: [{
? ? ? ? ? ? ? ? id: 8,
? ? ? ? ? ? ? ? label: '二級 8-1',
? ? ? ? ? ? ? ? children: [{
? ? ? ? ? ? ? ? ? id: 9,
? ? ? ? ? ? ? ? ? label: '三級 3-1-1'
? ? ? ? ? ? ? ? }, {
? ? ? ? ? ? ? ? ? id: 10,
? ? ? ? ? ? ? ? ? label: '三級 3-1-2',
? ? ? ? ? ? ? ? ? disabled: true
? ? ? ? ? ? ? ? }]
? ? ? ? ? ? ? }]
? ? ? ? ? ? }]
? ? ? ? ? }]
? ? ? ? }],
? ? ? ? defaultProps: {
? ? ? ? ? // 用于修改節(jié)點(diǎn)指定標(biāo)簽的屬性值
? ? ? ? ? children: 'children',
? ? ? ? ? label: 'label'
? ? ? ? }
? ? }
? },
? methods: {
? ? allowDrop(draggingNode, dropNode, type) {
? ? ? ? if (draggingNode.parrent.id=== dropNode.parrent.id) {
? ? ? ? ? return type !== 'next';
? ? ? ? } else {
? ? ? ? ? return true;
? ? ? ? }
? ? ? }
? }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
/* 樹形結(jié)構(gòu)節(jié)點(diǎn)添加連線 */
.tree /deep/ .el-tree-node {
? position: relative;
? padding-left: 16px;
}
?
.tree /deep/ .el-tree-node__children {
? padding-left: 12px;
}
?
.tree /deep/ .el-tree-node :last-child:before {
? height: 50px;
}
.tree /deep/ > .el-tree-node:before {
? border: none !important;
}
.tree /deep/ .el-tree > .el-tree-node:before {
? border-left: none;
}
?
.tree-container /deep/ .el-tree > .el-tree-node:after {
? border-top: none;
}
?
.tree /deep/ .el-tree-node:before {
? content: "";
? left: -4px;
? position: absolute;
? right: auto;
? border-width: 1px;
}
?
.tree /deep/ .el-tree-node:after {
? content: "";
? left: -4px;
? position: absolute;
? right: auto;
? border-width: 1px;
}
.tree /deep/ .el-tree-node__expand-icon.is-leaf {
? display: none;
}
?
.tree /deep/ .el-tree-node:before {
? border-left: 1px solid #b8b9bb;
? bottom: 0px;
? height: 100%;
? top: -26px;
? width: 1px;
}
?
.tree /deep/ .el-tree-node:after {
? border-top: 1px solid #b8b9bb;
? height: 20px;
? top: 24px;
? width: 20px;
}

.tree /deep/ .el-tree-node__expand-icon{
? display: none;
}
.tree /deep/ .el-tree-node__content{
? padding-left: 0 !important;
}

.tree /deep/ .el-tree-node__content {
? height: 18px;padding-top: 16px;
}

</style>

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • el-table點(diǎn)擊某一行高亮并顯示小圓點(diǎn)的實(shí)現(xiàn)代碼

    el-table點(diǎn)擊某一行高亮并顯示小圓點(diǎn)的實(shí)現(xiàn)代碼

    這篇文章主要介紹了el-table點(diǎn)擊某一行高亮并顯示小圓點(diǎn),本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-08-08
  • Vue 2.0入門基礎(chǔ)知識之內(nèi)部指令詳解

    Vue 2.0入門基礎(chǔ)知識之內(nèi)部指令詳解

    這篇文章主要介紹了Vue 2.0入門基礎(chǔ)知識之內(nèi)部指令知識,非常不錯(cuò),具有參考借鑒價(jià)值 ,需要的朋友可以參考下
    2017-10-10
  • Vue.js 中的 $watch使用方法

    Vue.js 中的 $watch使用方法

    本篇文章中主要介紹了Vue.js 中的 $watch使用方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-05-05
  • vue項(xiàng)目中swiper輪播active圖片實(shí)現(xiàn)居中并放大

    vue項(xiàng)目中swiper輪播active圖片實(shí)現(xiàn)居中并放大

    這篇文章主要介紹了vue項(xiàng)目中swiper輪播active圖片實(shí)現(xiàn)居中并放大方式,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-05-05
  • vue 組件prop驗(yàn)證作用示例解析

    vue 組件prop驗(yàn)證作用示例解析

    這篇文章主要為大家介紹了vue組件prop驗(yàn)證作用示例解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-08-08
  • vue出現(xiàn)Uncaught SyntaxError:Unexpected token問題及解決

    vue出現(xiàn)Uncaught SyntaxError:Unexpected token問題及解決

    這篇文章主要介紹了vue出現(xiàn)Uncaught SyntaxError:Unexpected token問題及解決,具有很好的參考價(jià)值,希望對大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-04-04
  • 一文詳解如何在Vue3中使用jsx/tsx

    一文詳解如何在Vue3中使用jsx/tsx

    本篇文章旨在帶領(lǐng)大家快速了解和使用?Vue?中的?JSX?語法,好讓大家在?Vue?中遇到或使用?JSX?的時(shí)候能很快入手,感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下
    2023-03-03
  • Vue3+Tsx給路由加切換動(dòng)畫時(shí)的踩坑及解決

    Vue3+Tsx給路由加切換動(dòng)畫時(shí)的踩坑及解決

    這篇文章主要介紹了Vue3+Tsx給路由加切換動(dòng)畫時(shí)的踩坑及解決,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-01-01
  • 如何使用Vue3設(shè)計(jì)實(shí)現(xiàn)一個(gè)Model組件淺析

    如何使用Vue3設(shè)計(jì)實(shí)現(xiàn)一個(gè)Model組件淺析

    v-model在Vue里面是一個(gè)語法糖,數(shù)據(jù)的雙向綁定,本質(zhì)上還是通過 自定義標(biāo)簽的attribute傳遞和接受,下面這篇文章主要給大家介紹了關(guān)于如何使用Vue3設(shè)計(jì)實(shí)現(xiàn)一個(gè)Model組件的相關(guān)資料,需要的朋友可以參考下
    2022-08-08
  • Vue路由模式中的hash和history模式詳細(xì)介紹

    Vue路由模式中的hash和history模式詳細(xì)介紹

    VUE分為兩種路由模式分別是hash(哈希)和history,他們的區(qū)別是hash模式不會(huì)包含在http請求中,并且不會(huì)重新加載頁面,而使用history模式的話,如果前端的url和后端發(fā)起請求的url不一致的話,會(huì)報(bào)404錯(cuò)誤,所以使用history模式的話我們需要和后端進(jìn)行配合
    2022-09-09

最新評論

滨州市| 长顺县| 栖霞市| 石嘴山市| 房山区| 保亭| 南部县| 龙游县| 汶川县| 文成县| 巩义市| 田东县| 华坪县| 土默特右旗| 梅河口市| 错那县| 连江县| 原阳县| 浦东新区| 苍山县| 安义县| 长岭县| 沧州市| 喀什市| 和静县| 什邡市| 柳河县| 长治县| 延安市| 改则县| 城步| 四川省| 甘德县| 武清区| 潼南县| 稻城县| 清丰县| 历史| 新宁县| 蒲城县| 多伦县|