femessage / el-select-area Goto Github PK
View Code? Open in Web Editor NEW🇨🇳Chinese area select component(including Taiwan、Hongkong、Macao)
Home Page: https://femessage.github.io/el-select-area/
License: MIT License
🇨🇳Chinese area select component(including Taiwan、Hongkong、Macao)
Home Page: https://femessage.github.io/el-select-area/
License: MIT License
默认尺寸size
应该和element保持一致,这样便于全局设置尺寸。
全局设置尺寸
Vue.prototype.$ELEMENT = {size: 'mini'}
原el-select 组件默认尺寸,可支持全局size
selectSize() {
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
}
el-select-area 问题点
size: {
type: String,
default: 'medium', #不应该设置
validator: val => ['small', 'medium', 'mini'].includes(val)
},
可修改为:
# 1.
size: {
type: String,
validator: val => ['small', 'medium', 'mini'].includes(val)
},
# 2.
size: {
type: String,
default(){
return (this.$ELEMENT || {}).size || 'medium'
},
validator: val => ['small', 'medium', 'mini'].includes(val)
},
能支持全局size设置
Describe the bug
设置type类型为all,触发重置操作之后,返回[{"":""},{"":""},{"":""}]
Expected behavior
重置之后应返回空数组[]
environment information:
问题
该组件第一次默认值,必须符合下拉列表中的一个。当传入值不存在的情况下,无论如何设置default属性,console总会提示该错误。
需求
当default=[]时,能否不报错? default属性是否可以更改为不必须字段?
使用如下配置el-data-table导致页面时正常时报错(刷新后规律地一次正常一次报错)
searchForm: [
{
$id: 'area',
$type: 'select-area',
label: '加盟区域',
$default: [],
},
]
加入inputFormat或outputFormat任一个就正常了
el-data-table 执行查询刷新页面后 URL query 保存了搜索参数,但相应的省市区没有选中
见仓库 的DEMO - el-data-table
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.