From b569c2254c1f870e174581c0825436a99c528097 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期一, 24 一月 2022 11:53:46 +0800 Subject: [PATCH] update: [滿意度通知] route query parameter - 清除方式調整 --- 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