-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: select提供选项定制和回显内容定制 * fix: 修复bug * doc: 更新文档 * fix: 降低点速速
- Loading branch information
Showing
10 changed files
with
178 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 19 additions & 11 deletions
30
docs/.vitepress/components/select/label.vue → ...epress/components/select/customOption.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<template> | ||
<FSelect :options="optionList" optionLabelField="x"></FSelect> | ||
</template> | ||
<script> | ||
import { reactive } from 'vue'; | ||
export default { | ||
setup() { | ||
const optionList = reactive([ | ||
{ | ||
value: 'HuNan', | ||
label: '湖南', | ||
x: 'HuNan-湖南', | ||
}, | ||
{ | ||
value: 'HuBei', | ||
label: '湖北', | ||
disabled: true, | ||
x: 'HuBei-湖北', | ||
}, | ||
{ | ||
value: 'ZheJiang', | ||
label: '浙江', | ||
x: 'ZheJiang-浙江', | ||
}, | ||
{ | ||
value: 'GuangDong', | ||
label: '广东', | ||
x: 'GuangDong-广东', | ||
}, | ||
{ | ||
value: 'JiangSu', | ||
label: '江苏', | ||
x: 'JiangSu-江苏', | ||
}, | ||
]); | ||
return { | ||
optionList, | ||
}; | ||
}, | ||
}; | ||
</script> | ||
<style scoped> | ||
.fes-select { | ||
width: 200px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<template> | ||
<FSelectTree :data="data" optionLabelField="x"></FSelectTree> | ||
</template> | ||
<script> | ||
import { reactive } from 'vue'; | ||
function createData(level = 1, baseKey = '', prefix = null, suffix = null) { | ||
if (!level) return undefined; | ||
return Array.apply(null, { length: 2 }).map((_, index) => { | ||
const key = '' + baseKey + level + index; | ||
return { | ||
label: createLabel(level), | ||
value: key, | ||
children: createData(level - 1, key, prefix, suffix), | ||
x: `${key}-${createLabel(level)}`, | ||
prefix: prefix ? () => h(PictureOutlined) : null, | ||
suffix: suffix ? () => h(PlusCircleOutlined) : null, | ||
}; | ||
}); | ||
} | ||
function createLabel(level) { | ||
if (level === 4) return '道生一'; | ||
if (level === 3) return '一生二'; | ||
if (level === 2) return '二生三'; | ||
if (level === 1) return '三生万物'; | ||
} | ||
export default { | ||
setup() { | ||
const data = reactive(createData(4)); | ||
return { | ||
data, | ||
}; | ||
}, | ||
}; | ||
</script> | ||
<style scoped> | ||
.fes-select-tree { | ||
width: 200px; | ||
} | ||
</style> |