element UI el-upload多张图 隐藏上传空间

先包裹displayNone一个class名 然后通过css隐藏

<div class="displayNone">
   <el-upload
     action="#"
     list-type="picture-card"
     :on-preview="handlePictureCardPreview"
     :file-list="fileList">
     <i class="el-icon-plus"></i>
   </el-upload>
 </div>

记住写全局的

<style>
  .displayNone div .el-upload--picture-card{
    display: none!important;
  }
</style
要实现在echarts中用el-radio-button按钮切换同的数据,可以先在vue中定义一个变量来存储当前选中的数据源,例如: ``` <template> <div> <el-radio-group v-model="selectedSource"> <el-radio-button :label="source1">数据源1</el-radio-button> <el-radio-button :label="source2">数据源2</el-radio-button> <el-radio-button :label="source3">数据源3</el-radio-button> </el-radio-group> <div id="chart"></div> </div> </template> <script> export default { data() { return { selectedSource: 'source1', // 默认选中数据源1 source1: [], // 数据源1 source2: [], // 数据源2 source3: [], // 数据源3 } }, methods: { fetchData() { // 使用fetch获取数据,并将返回的数据赋值给对应的数据源 fetch('/api/data1').then(response => response.json()).then(data => this.source1 = data) fetch('/api/data2').then(response => response.json()).then(data => this.source2 = data) fetch('/api/data3').then(response => response.json()).then(data => this.source3 = data) }, renderChart() { // 根据当前选中的数据源渲染表 const data = this[this.selectedSource] // 使用echarts绘制表 const chart = echarts.init(document.getElementById('chart')) chart.setOption({ // 配置表选项 series: [ { type: 'bar', data, }, ], }) }, }, mounted() { this.fetchData() // 获取数据 this.renderChart() // 渲染表 }, watch: { selectedSource() { this.renderChart() // 监听选中的数据源变化,重新渲染表 }, }, } </script> ``` 在上面的代码中,我们定义了一个selectedSource变量来存储当前选中的数据源,然后在模板中使用el-radio-button按钮来选择同的数据源。在mounted钩子函数中,我们调用fetchData方法来获取数据,在renderChart方法中根据当前选中的数据源渲染表。同时,我们使用watch监听selectedSource变量的变化,一旦变化就重新渲染表。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值