[TOC]
# Tag 標簽
用于展示文字標簽,可點擊切換選中、不選中的狀態,組件名:`ts-tag`。
**使用方式:**
在`script`中引用組件
~~~
import tsTag from "@/components/teaset/components/ts-tag/ts-tag.vue"
export default {
components: {tsTag}
}
~~~
在`template`中使用組件
~~~
<ts-tag text="標簽" type="primary"></ts-tag>
<ts-tag text="標簽" type="error" :circle="true"></ts-tag>
<ts-tag text="標簽" @click="bindClick"></ts-tag>
~~~
```
<view>
<ts-tag text="12345" type="error" size="normal"></ts-tag>
<ts-tag text="12345" type="warning" size="small"></ts-tag>
<ts-tag text="12345" type="primary" size="small"></ts-tag>
<ts-tag text="12345" type="success" size="small"></ts-tag>
</view>
```
**屬性說明:**
| 屬性名 | 類型 | 默認值 | 說明 |
| --- | --- | --- | --- |
| text | String | \- | 標簽內容 |
| size | String | normal | 大小尺寸,可選值:normal、small |
| type | String | default | 顏色類型,可選值:default(灰色)、primary(藍色)、success(綠色)、warning(黃色)、error(紅色) |
| disabled | Boolean | false | 是否為禁用狀態 |
| inverted | Boolean | false | 是否無需背景顏色(空心標簽) |
| circle | Boolean | false | 是否為圓角 |
**事件說明:**
| 事件稱名 | 說明 |
| --- | --- |
| click | 點擊 Tag 觸發事件 |
# Tags標簽組
顯示一組標簽
**使用方式:**
在`script`中引用組件
~~~
import tsTags from "@/components/teaset/components/ts-tag/ts-tags.vue"
export default {
components: {tsTags}
}
~~~
在`template`中使用組件
~~~
<ts-tags v-model="tags" type="error" :enable-del="false" :enable-add="false" size="normal" :mark='true'
inverted='true'></ts-tags>
~~~
其中v-model實現雙向綁定tags.
**屬性說明:**
| 屬性名 | 類型 | 默認值 | 說明 |
| --- | --- | --- | --- |
| value| Array| \- | 標簽數組 |
| size | String | normal | 大小尺寸,可選值:normal、small、large |
| type | String | default | 顏色類型,可選值:default(灰色)、primary(藍色)、success(綠色)、warning(黃色)、error(紅色) |
| disabled | Boolean | false | 是否為禁用狀態 |
| inverted | Boolean | false | 是否無需背景顏色(空心標簽) |
| circle | Boolean | false | 是否為圓角 |
## 一個可編輯的標簽的例子
```
<template>
<view class="ts-column ts-flex-item ts-padding">
<view>
帶刪除,帶添加,primary背景色
</view>
<ts-tags v-model="tabData" type="error" :enable-del="showDel" :enable-add="showAdd" size="normal" :mark='false'
:inverted='true' :circle="true" @add='addTag' @delete="deleteTag"></ts-tags>
<view :key="index" v-for="(tag,index) in tabData">
{{index}}. {{tag}}
</view>
</view>
</template>
<script>
import tsTags from '@/components/teaset/components/ts-tag/ts-tags.vue'
export default {
components: {
tsTags
},
data() {
return {
tabData: ['建筑', '動漫', '藝術'],
// tabData: "計算機,體育",
showDel: true,
showAdd: true
}
},
methods: {
clickTag: function(e) {
console.log(e)
},
deleteTag: function(e) {
console.log(e)
},
addTag: function(e) {
console.log(e)
console.log(this.tabData)
}
}
}
</script>
<style>
</style>
```
# TagSelector
- 內容介紹
- EcmaScript基礎
- 快速入門
- 常量與變量
- 字符串
- 函數的基本概念
- 條件判斷
- 數組
- 循環
- while循環
- for循環
- 函數基礎
- 對象
- 對象的方法
- 函數
- 變量作用域
- 箭頭函數
- 閉包
- 高階函數
- map/reduce
- filter
- sort
- Promise
- 基本對象
- Arguments 對象
- 剩余參數
- Map和Set
- Json基礎
- RegExp
- Date
- async
- callback
- promise基礎
- promise-api
- promise鏈
- async-await
- 項目實踐
- 標簽系統
- 遠程API請求
- 面向對象編程
- 創建對象
- 原型繼承
- 項目實踐
- Classes
- 構造函數
- extends
- static
- 項目實踐
- 模塊
- import
- export
- 項目實踐
- 第三方擴展庫
- immutable
- Vue快速入門
- 理解MVVM
- Vue中的MVVM模型
- Webpack+Vue快速入門
- 模板語法
- 計算屬性和偵聽器
- Class 與 Style 綁定
- 條件渲染
- 列表渲染
- 事件處理
- 表單輸入綁定
- 組件基礎
- 組件注冊
- Prop
- 自定義事件
- 插槽
- 混入
- 過濾器
- 項目實踐
- 標簽編輯
- 移動客戶端開發
- uni-app基礎
- 快速入門程序
- 單頁程序
- 底部Tab導航
- Vue語法基礎
- 模版語法
- 計算屬性與偵聽器
- Class與Style綁定
- 樣式與布局
- Box模型
- Flex布局
- 內置指令
- 基本指令
- v-model與表單
- 條件渲染指令
- 列表渲染指令v-for
- 事件與自定義屬性
- 生命周期
- 項目實踐
- 學生實驗
- 貝店商品列表
- 加載更多數據
- 詳情頁面
- 自定義組件
- 內置組件
- 表單組件
- 技術專題
- 狀態管理vuex
- Flyio
- Mockjs
- SCSS
- 條件編譯
- 常用功能實現
- 上拉加載更多數據
- 數據加載綜合案例
- Teaset UI組件庫
- Teaset設計
- Teaset使用基礎
- ts-tag
- ts-badge
- ts-button
- ta-banner
- ts-list
- ts-icon
- ts-load-more
- ts-segmented-control
- 代碼模版
- 項目實踐
- 標簽組件
- 失物招領客戶端原型
- 發布頁面
- 檢索頁面
- 詳情頁面
- 服務端開發技術
- 服務端開發環境配置
- Koajs快速入門
- 快速入門
- 常用Koa中間件介紹
- 文件上傳
- RestfulApi
- 一個復雜的RESTful例子
- 使用Mockjs生成模擬數據
- Thinkjs快速入門
- MVC模式
- Thinkjs介紹
- 快速入門
- RESTful服務
- RBAC案例
- 關聯模型
- 應用開發框架
- 服務端開發
- PC端管理界面開發
- 移動端開發
- 項目實踐
- 失物招領項目
- 移動客戶端UI設計
- 服務端設計
- 數據庫設計
- Event(事件)
- 客戶端設計
- 事件列表頁面
- 發布頁面
- 事件詳情頁面
- API設計
- image
- event
- 微信公眾號開發
- ui設計規范