element-ui中使用单选框,但单选框后面会带一个index,请问这是什么原因?

<el-table-column label="单选" width="55">
        <template scope="scope">
          <el-radio
                     :label="scope.$index"
                     v-model="radio"></el-radio>
        </template>
</el-table-column>

请问各位大神,怎么能把后面带的index去掉

阅读 7.4k
6 个回答

里面没有字符串的话就是这样,加个&nbsp;

<el-radio class="radio" v-model="radio" :label="scope.$index">&nbsp;</el-radio>

:label="scope.$index"

:label="scope.$index"这个玩意的锅

因为你绑定了label,把:label="scope.$index"去掉就没了

不写文字默认按label属性显示,标签内加上文字就好

:label = "scope.$index"

这是放在table的里面的某一行的index

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题