保誠-保戶業務員媒合平台
劉鈞霖
2021-12-27 b81b27ce3e7e9e7cda18bb6a621c34e84e7e2311
PAMapp/components/singleSelectBtn.vue
@@ -23,11 +23,15 @@
  import * as _ from 'lodash';
  @Component
  export default class SingleSelectBtn extends Vue {
    @PropSync('singleSelected', { default: '' }) syncSingleSelected!: string | number;
    @Prop({ type:Array , default:()=>[] }) options!:OptionBtnDto[];
    @PropSync('singleSelected', { default: '' })
    syncSingleSelected!: string | number;
    // 主要解決按鈕點擊兩次能回到,未點選的狀態
    patchValue(value: string): void {
    @Prop({ type:Array , default:()=>[] })
    options!:OptionBtnDto[];
    //////////////////////////////////////////////////////////////////////
    patchValue(value: string | number): void {
      // 主要解決按鈕點擊兩次能回到,未點選的狀態
      this.syncSingleSelected = _.isEqual(this.syncSingleSelected, value) ? "" : value;
    }
  }
@@ -37,8 +41,3 @@
    label: string | number,
  }
</script>
<style lang="scss"
  scoped>
</style>