From 66f726b6643e85cd6ec0041d01b31d38b3803c1a Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期三, 26 一月 2022 10:56:05 +0800 Subject: [PATCH] add#134789: [顧問] 過久未回應的預約單流程 --- 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