| | |
| | | |
| | | @Component |
| | | export default class MultiSelectBtn extends Vue { |
| | | |
| | | @PropSync('mutiSelect',{type:Array,default:()=>[]}) |
| | | syncMutiSelect!:string[]; |
| | | |
| | |
| | | isSelectAll=false; |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | updated() { |
| | | this.isSelectAll = this.syncMutiSelect.length === this.options.length; |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | selectAll():void{ |
| | | this.isSelectAll= !this.isSelectAll; |
| | | this.syncMutiSelect = this.isSelectAll ? this.optionsFormat(this.options):[]; |
| | | } |
| | | optionsFormat(optios:OptionBtnDto[]):string[]{ |
| | | return optios.map(o=>o.title); |
| | | |
| | | optionsFormat(options:OptionBtnDto[]): string[] { |
| | | return options.map((option)=> option.title ); |
| | | } |
| | | |
| | | selectOther():void{ |
| | | this.isSelectOtherOption = !this.isSelectOtherOption; |
| | | if(!this.isSelectOtherOption){ |