垂直选择按钮无法正确更改内容

时间:2019-06-14 19:00:26

标签: javascript html vue.js

我有一个带有两个v选择按钮的前端,可以显示4种o型图表,但是它们不能正确显示图表

我有一个名为selectedItems的按钮,显示了“ SMS enviados”和“ SMS Respondidos”项,还有一个名为selectedCampaigns的按钮,其中有“ Geral”和“ Campanha 1”项

加载页面时显示的标准图表是带有“ SMS enviados”和“ Geral”的图表,但是当我选择“ SMS enviados”和“ Campanha 1”时,该图表不会更改。

有人知道为什么吗?

    methods: {
          retrieveChartData (selectedItem, selectedCampaigns) {
            let apiUrl;
    if (!selectedItem || selectedItem === 'SMS Enviados' && !selectedCampaigns || selectedCampaigns === 'Geral') {
          apiUrl = 'https://6um8xmj8p3.execute-api.sa-east-1.amazonaws.com/default/scanUsersSemana';
          this.totalSms = 0;
        } else if ((!selectedItem || selectedItem === 'SMS Enviados') && (!selectedCampaigns || selectedCampaigns === 'Campanha 1')) {
          apiUrl = 'https://6um8xmj8p3.execute-api.sa-east-1.amazonaws.com/default/scanUsersCampanha1';
          this.totalSms = 0;
        } else if (!selectedItem || selectedItem === 'SMS Respondidos' && !selectedCampaigns || selectedCampaigns === 'Geral') {
          apiUrl = 'https://6um8xmj8p3.execute-api.sa-east-1.amazonaws.com/default/scanUsersRespondidos';
          this.totalSms = 0;
        } else if (!selectedItem || selectedItem === 'SMS Respondidos' && !selectedCampaigns || selectedCampaigns === 'Campanha 1') {
          apiUrl = 'https://6um8xmj8p3.execute-api.sa-east-1.amazonaws.com/default/scanUsersLambda';
          this.totalSms = 0;
          }
     }
}

0 个答案:

没有答案