<Card>
          <Select v-model="typeSelect" style="width:150px;float: right;z-index:999;position: relative" placeholder="请选择指标" @click="changeType()">
            <Option v-for="type in typeArray" :value="type.value" :key="type.label">{{ type.label }}</Option>
          </Select>
          <chart-card :stats-data="playTypePie"></chart-card>
        </Card>
    changeType:function (){
      console.log('您选择了', this.typeSelect)
    },
在点击选择数据类型的时候发现无法触发changeType().

@click="getDivision()"换成@click.native="getDivision()"就可以了
 

给vue组件绑定事件时候,必须加上native ,不然不会生效(监听根元素的原生事件,使用 .native 修饰符)

Logo

前往低代码交流专区

更多推荐