保誠-保戶業務員媒合平台
Tomas
2021-12-27 c9b1f11a9655813773e009286467af5044106d6e
PAMapp/components/multiSelectBtn.vue
@@ -30,6 +30,7 @@
  @Component
  export default class MultiSelectBtn extends Vue {
    @PropSync('mutiSelect',{type:Array,default:()=>[]})
    syncMutiSelect!:string[];
@@ -49,18 +50,22 @@
    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){