From f8ab133a7dc20562c25a092a402266f5e7b0b296 Mon Sep 17 00:00:00 2001 From: Jack <jack.su@pollex.com.tw> Date: 星期一, 24 一月 2022 10:29:38 +0800 Subject: [PATCH] Merge branch 'Phase3' of ssh://dev.pollex.com.tw:29418/pcalife/PAM into Phase3 --- PAMapp/components/multiSelectBtn.vue | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/PAMapp/components/multiSelectBtn.vue b/PAMapp/components/multiSelectBtn.vue index 4ecd3c9..0abc66e 100644 --- a/PAMapp/components/multiSelectBtn.vue +++ b/PAMapp/components/multiSelectBtn.vue @@ -25,8 +25,8 @@ </template> <script lang="ts"> - import { Vue, Component, Prop, PropSync} from 'vue-property-decorator'; - import { OptionBtnDto } from './singleSelectBtn.vue'; + import { Vue, Component, Prop, PropSync, Watch} from 'vue-property-decorator'; +import { OptionBtnDto } from '~/shared/models/optionBtnDto.model'; @Component export default class MultiSelectBtn extends Vue { @@ -46,6 +46,17 @@ @Prop({type:String,default:''}) nameOfOtherOption!:string; + @Prop() + maxLength? : number; + + @Watch('syncMutiSelect') + onMutiSelectChange(): void { + if (!this.maxLength) return; + if (this.syncMutiSelect.length > this.maxLength) { + this.syncMutiSelect.shift(); + } + } + isSelectOtherOption=false; isSelectAll=false; -- Gitblit v1.8.0