> For the complete documentation index, see [llms.txt](https://jim-5.gitbook.io/vue-js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jim-5.gitbook.io/vue-js/zhi-ling-pian.md).

# VUE指令

```javascript
//範例
```

* **v-bind：用於動態輸出HTML元素上的屬性。例id、class、自訂等。**

  此動態值，可當成前端的session，讓元件間取用。
* **v-on：綁定事件監聽器**
* **v-if：若其內的值是true則顯示該元素，false則隱藏該元素。**
* **v-html：輸出HTML，而非純文字**
* **v-pre：不進行編輯(內部文字跳脫的意思)**
* **v-for：用陣列輸出該組合的迴圈**
* **v-model：用在各種表單內的控制項，讓輸入值與data同步**
  * **有修飾符號。例：.lazy。.number。.trim。**
* **is：在table或select內強制放入等元件**
* **自訂指令：用自訂的函數去處理動態屬性**

```javascript
//用time來處理後方的動態屬性值
<div v-time="timeBefore"></div>

//第一個參數是指令名稱，第二個參數是各類型的鉤子函數(觸發時機)
Vue.directive('time',{
    bind:function(){}
    unbind:function(){}
})
```
