亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

vue+iview使用樹形控件的具體使用

 更新時(shí)間:2020年11月02日 10:48:09   作者:灰太狼的情與殤  
這篇文章主要介紹了vue+iview使用樹形控件的具體使用,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

vue+iview使用樹形控件

1.開發(fā)環(huán)境 vue+iview

2.電腦系統(tǒng) windows10專業(yè)版

3.在使用 vue+iview開發(fā)的過程中,我們經(jīng)常會(huì)使用 iview的樹形控件,在這里我就簡(jiǎn)單的做一個(gè)分享,希望對(duì)你有所幫助!

4.在template中添加如下代碼:

<Scroll style="width: 100%" height="760">
 <Tree
   @on-select-change="chentreelick"
   :data="treedata"
    expand-node
 ></Tree>
</Scroll>

5.在 return 中添加如下代碼:

treedata: [
    {
     title: "parent 1",
     chenshow: false,
     expand: true,
     children: [
      {
       title: "parent 1-1",
       chenshow: false,
       expand: true,
       children: [
        {
         title: "leaf 1-1-1",
         chenshow: true,
        },
        {
         title: "leaf 1-1-2",
         chenshow: true,
         selected: true,
        },
       ],
      },
      {
       title: "parent 1-2",
       chenshow: false,
       expand: true,
       children: [
        {
         title: "leaf 1-2-1",
         chenshow: true,
        },
        {
         title: "leaf 1-2-1",
         chenshow: true,
        },
       ],
      },
      {
       title: "parent 1-3",
       chenshow: false,
       expand: true,
       children: [
        {
         title: "leaf 1-3-1",
         chenshow: true,
        },
        {
         title: "leaf 1-3-1",
         chenshow: true,
        },
       ],
      },
      {
       title: "parent 1-4",
       chenshow: false,
       expand: true,
       children: [
        {
         title: "leaf 1-4-1",
         chenshow: true,
        },
        {
         title: "leaf 1-4-1",
         chenshow: true,
        },
       ],
      },
      {
       title: "parent 1-5",
       chenshow: false,
       expand: true,
       children: [
        {
         title: "leaf 1-5-1",
         chenshow: true,
        },
        {
         title: "leaf 1-5-1",
         chenshow: true,
        },
       ],
      },
      {
       title: "parent 1-6",
       chenshow: false,
       expand: true,
       children: [
        {
         title: "leaf 1-6-1",
         chenshow: true,
        },
        {
         title: "leaf 1-6-1",
         chenshow: true,
        },
       ],
      },
      {
       title: "parent 1-7",
       chenshow: false,
       expand: true,
       children: [
        {
         title: "leaf 1-7-1",
         chenshow: true,
        },
        {
         title: "leaf 1-7-1",
         chenshow: true,
        },
       ],
      },
      {
       title: "parent 1-8",
       chenshow: false,
       expand: true,
       children: [
        {
         title: "leaf 1-8-1",
         chenshow: true,
        },
        {
         title: "leaf 1-8-1",
         chenshow: true,
        },
       ],
      },
      {
       title: "parent 1-9",
       chenshow: false,
       expand: true,
       children: [
        {
         title: "leaf 1-9-1",
         chenshow: true,
        },
        {
         title: "leaf 1-9-1",
         chenshow: true,
        },
       ],
      },
     ],
    },
   ],

5-1.注意 這個(gè) return中綁定的數(shù)據(jù),可以參考 iview官方文檔,地址如下:

https://www.iviewui.com/components/tree

6.在 methods中添加如下代碼:

chentreelick(data) {
   console.log(data);
   console.log("點(diǎn)擊了");
   console.log(data[0].chenshow);
  },
  
  //注意:參數(shù) data,在點(diǎn)擊的時(shí)候可以獲取到后臺(tái)的數(shù)據(jù),這個(gè)數(shù)據(jù)是來自后臺(tái)的,在實(shí)際開發(fā)中,我們可以 利用 data,把后臺(tái)需要的id傳給 后臺(tái)

到此這篇關(guān)于vue+iview使用樹形控件的具體使用的文章就介紹到這了,更多相關(guān)vue iview 樹形控件內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • vue-cli腳手架的.babelrc文件用法說明

    vue-cli腳手架的.babelrc文件用法說明

    這篇文章主要介紹了vue-cli腳手架的.babelrc文件用法說明,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2020-09-09
  • vue自定義指令限制輸入框輸入值的步驟與完整代碼

    vue自定義指令限制輸入框輸入值的步驟與完整代碼

    這篇文章主要給大家介紹了關(guān)于vue自定義指令限制輸入框輸入值的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-08-08
  • 解決IOS端微信H5頁面軟鍵盤彈起后頁面下方留白的問題

    解決IOS端微信H5頁面軟鍵盤彈起后頁面下方留白的問題

    微信H5項(xiàng)目,ios端出現(xiàn)了軟鍵盤輸完隱藏后頁面不會(huì)回彈,下方會(huì)有一大塊留白。這篇文章主要介紹了決微信H5頁面軟鍵盤彈起后頁面下方留白的問題(iOS端) ,需要的朋友可以參考下
    2019-06-06
  • Vue?Cli中的環(huán)境變量和模式

    Vue?Cli中的環(huán)境變量和模式

    這篇文章主要介紹了Vue?Cli中的環(huán)境變量和模式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-10-10
  • vue 解決addRoutes多次添加路由重復(fù)的操作

    vue 解決addRoutes多次添加路由重復(fù)的操作

    這篇文章主要介紹了vue 解決addRoutes多次添加路由重復(fù)的操作,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2020-08-08
  • vue項(xiàng)目中使用this.$confirm解析

    vue項(xiàng)目中使用this.$confirm解析

    這篇文章主要介紹了vue項(xiàng)目中使用this.$confirm方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-09-09
  • vue3+ts+EsLint+Prettier規(guī)范代碼的方法實(shí)現(xiàn)

    vue3+ts+EsLint+Prettier規(guī)范代碼的方法實(shí)現(xiàn)

    本文主要介紹在Vue3中使用TypeScript做開發(fā)時(shí),如何安裝與配置EsLint和Prettier,以提高編碼規(guī)范。感興趣的可以了解一下
    2021-10-10
  • vue項(xiàng)目實(shí)例中用query傳參如何實(shí)現(xiàn)跳轉(zhuǎn)效果

    vue項(xiàng)目實(shí)例中用query傳參如何實(shí)現(xiàn)跳轉(zhuǎn)效果

    這篇文章主要介紹了vue項(xiàng)目實(shí)例中用query傳參如何實(shí)現(xiàn)跳轉(zhuǎn)效果,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-10-10
  • vue :style設(shè)置背景圖片方式backgroundImage

    vue :style設(shè)置背景圖片方式backgroundImage

    這篇文章主要介紹了vue :style設(shè)置背景圖片方式backgroundImage,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-10-10
  • Vue 用Vant實(shí)現(xiàn)時(shí)間選擇器的示例代碼

    Vue 用Vant實(shí)現(xiàn)時(shí)間選擇器的示例代碼

    這篇文章主要介紹了Vue 用Vant實(shí)現(xiàn)時(shí)間選擇器的示例代碼,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-10-10

最新評(píng)論