# Driver

## Sample

```javascript
 "measures":{
    "drive":{
      "name":"drive1",
      "title":"Drive",
     },
   }
```

&#x20;download excample widget from here :  <https://www.deviantart.com/rainysoft/art/Drives-Line-762679228>

![](https://1714184600-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LLMQh2b_BsX_vNTkcp4%2F-LLdKKdO1cF7JbyS76nE%2F-LLdKtUj4CTWNzf5liXI%2F1.jpg?alt=media\&token=853b59f3-c6a6-4471-97b2-757d648c12d7)

## Information <a href="#information" id="information"></a>

* Measure Type: **drive**
* Description: "drive" measure used to display all drives on your computer ,include USB drive when USB inserted

## Propertys

### isAllDrive

Whether to automatically detect all drives. users can change it by settings. default value is "**true**".

### drives

if "isAllDrive" is false, drive measure will only detect the drives that include "drives", for example  this code will only detect the drives of "C,E,H"

```javascript
 "drive":{
      "name" : "drive1",
      "title" : "Drive",
      "isAllDrive" : "false",
      "drives" : "C,E,H"
     },
```

### items

all the drives that detected are in items,every item include these data tags:

```javascript
volume  //the drive item volume name
label   //the drive item label name
driveType  //0=unknown,2=Removeable(USB),3=fixed(HDD),4-remote,5=CDROM,6=RAM Disk
total   //the drive item totole size with auto scale unit,e.g.  8.2G , 1.9T
used    //the drive item used size with auto scale unit,e.g.  8.2G , 1.9T
free    //the drive item free size with auto scale unit,e.g.  8.2G , 1.9T

totalM  //the drive item total MB size without unit,e.g.  8.2 , 1900
usedM   //the drive item used MB size without unit,e.g.  8.2 , 1900
freeM   //the drive item freeM MB size without unit,e.g.  8.2 , 1900

totalG  //the drive item total GB size without unit,e.g.  8.2 , 1900
usedG   //the drive item used GB size without unit,e.g.  8.2 , 1900
freeG   //the drive item freeM GB size without unit,e.g.  8.2 , 1900

percent    //the drive item used size percent,e.g.  82 , 19
freePercent    //the drive item free size percent,e.g.  18 , 81

tenth   //the drive item used size tenth (0~10),e.g.  8 , 2
freeTenth   //the drive item free size tenth (0~10),e.g.  2 , 8

open   //Used to bind the onclick event to open this drive
eject  //Used to bind the onclick event to eject this drive(only for USB and CDROM)
```

e.g. List all the drives volume on your computer:  `<li v-for="item in drive1.items"> {{ item.volume }} </li>` &#x20;

e.g. Click to open the drive item with item.**open** :\
&#x20;`<li v-for="item in drive1.items" v-bind:onclick="item.open" > {{ item.volume }} </li>` &#x20;

e.g. Click to eject the drive item with item.**eject** if the drive is USB or CDROM:\
&#x20;`<li v-for="item in drive1.items" v-bind:onclick="item.eject" > {{ item.volume }} </li>` &#x20;

### Other data tags

```
allTotal  //all drives that detected total size with auto scale unit,e.g. 1.9T,820G
allUsed   //all drives that detected used size with auto scale unit,e.g. 1.9T,820G
allFree   //all drives that detected free size with auto scale unit,e.g. 1.9T,820G

allTotalM //all drives that detected total MB size without unit,e.g. 1900,82
allUsedM  //all drives that detected used MB size without unit,e.g. 1900,82
allFreeM  //all drives that detected free MB size without unit,e.g. 1900,82

allTotalG //all drives that detected total GB size without unit,e.g. 1900,82 
allUsedG  //all drives that detected used GB size without unit,e.g. 1900,82
allFreeG  //all drives that detected free GB size without unit,e.g. 1900,82

allTotalT //all drives that detected total TB size without unit,e.g. 1900,82 
allUsedT  //all drives that detected used TB size without unit,e.g. 1900,82
allFreeT  //all drives that detected free TB size without unit,e.g. 1900,82

allPercent    //all drives that detected used size percent,e.g.  82 , 19
allFreePercent //all drives that detected free size percent,e.g.  18 , 81
allTenth   //all the drives used size tenth (0~10),e.g.  8 , 2
allFreeTenth  //all the drives free size tenth (0~10),e.g.  2 , 8
```

e.g. display the total space size of all the disk drives on  your computer \
&#x20;`<div id="widget">{{ drive1.allTotal }} </div>`  &#x20;
