新增TagSelect组件
This commit is contained in:
36
src/components/tool/TagSelect.vue
Normal file
36
src/components/tool/TagSelect.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div class="tag-select">
|
||||
<tag-select-option>全部</tag-select-option>
|
||||
<slot></slot>
|
||||
<a class="trigger">展开<a-icon type="down"/></a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ASelect from 'vue-antd-ui/es/select/index'
|
||||
import ACheckableTag from 'vue-antd-ui/es/tag/CheckableTag'
|
||||
import TagSelectOption from './TagSelectOption'
|
||||
import AIcon from 'vue-antd-ui/es/icon/icon'
|
||||
export default {
|
||||
name: 'TagSelect',
|
||||
Option: TagSelectOption,
|
||||
components: {AIcon, TagSelectOption, ACheckableTag, ASelect}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.tag-select{
|
||||
user-select: none;
|
||||
margin-left: -8px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
max-height: 32px;
|
||||
line-height: 32px;
|
||||
padding-right: 50px;
|
||||
}
|
||||
.trigger{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
</style>
|
||||
34
src/components/tool/TagSelectOption.vue
Normal file
34
src/components/tool/TagSelectOption.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<a-checkable-tag class="tag-default" v-model="checked">
|
||||
<slot></slot>
|
||||
</a-checkable-tag>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ACheckableTag from 'vue-antd-ui/es/tag/CheckableTag'
|
||||
export default {
|
||||
name: 'TagSelectOption',
|
||||
components: {ACheckableTag},
|
||||
options: {
|
||||
size: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: 'default'
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
checked: false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.tag-default{
|
||||
font-size: 14px;
|
||||
padding: 0 8px;
|
||||
height: auto;
|
||||
margin-right: 24px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user