Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于 el-radio-group 增加垂直排列的建议 #3037

Closed
liyanlong opened this issue Feb 24, 2017 · 16 comments
Closed

关于 el-radio-group 增加垂直排列的建议 #3037

liyanlong opened this issue Feb 24, 2017 · 16 comments

Comments

@liyanlong
Copy link
Contributor

liyanlong commented Feb 24, 2017

ElementUI version

1.2.1

建议内容

使用 el-radio-group, 觉得只能进行水平排列有点单一. 是否可以增加垂直排列

可以尝试加上一个 type 来控制..

<template>
<el-radio-group v-model="selectMod" size="small" type="vertical">
      <el-radio-button label="第一列"></el-radio-button>
      <el-radio-button label="第二列"></el-radio-button>
      <el-radio-button label="第三列"></el-radio-button>
</el-radio-group>
</template>
<script>
export default {
  data () {
    return {
        selectMod: '第一列' 
    }
  }
}
</script>

Exmaple

image

@baiyaaaaa
Copy link
Contributor

没有太多人有这个需求,可能暂时没有这个计划,你可以用CSS处理。

@An0nymous0
Copy link

@baiyaaaaa 同求

@liangklfangl
Copy link

同求

@Missna
Copy link

Missna commented Apr 23, 2018

可以通过添加div实现垂直排列

<template>
<el-radio-group v-model="selectMod" size="small" type="vertical">
<div v-for= index of 3>
 <el-radio-button label="第一列"></el-radio-button>
</div>
</el-radio-group>
</template>

@ALiangLiang
Copy link

同求

@bilibiliou
Copy link

真坑,这个需求实现起来这么麻烦吗?

@popbayun
Copy link


@plumos
Copy link

plumos commented Feb 23, 2020

2020了,这个功能开发出来了吗?

@flyher
Copy link

flyher commented Apr 29, 2020

el-checkbox嵌入个style="display:block;"临时解决一下吧。

@dd1994
Copy link

dd1994 commented Jun 18, 2020

同求 现在每次都是覆盖样式

@guominfang
Copy link

@baiyaaaaa 这样样式需求很多人使用吧,希望能打开或者合并

@yiyiyiqi
Copy link

同求,2022了,需求实现了吗

@shadowfax-h
Copy link

可以用div来实现。<div><el-radio></el-radio></div><div><el-radio></el-radio></div>

@ppkliu
Copy link

ppkliu commented Jan 20, 2022

參考這篇, 手動對齊一下就可以了!
https://stackoverflow.com/questions/46874662/vertically-aligning-radio-buttons-in-center-aligned-text


      <div style="text-align: center; display:block;">
        <el-radio-group v-model="myrole" class='radioDiv'>
            <div><el-radio :label="3" >AAAAAAAAAA</el-radio></div>
            <div><el-radio :label="2" >BBBBBBB</el-radio></div>
            <div><el-radio :label="1" >CC</el-radio></div>
            <div><el-radio :label="0" >DDDD</el-radio></div>
        </el-radio-group>
      </div>

/* 這邊放class 的css */
<style scoped>
 .radioDiv {
   margin: 0 auto;
   width: auto;
   text-align: left;
   display: table;
}
</style>

@warren30815
Copy link

A workaround is:

  1. add style="display: table;" to el-radio-group
  2. wrap each el-radio with div

code:
Screen Shot 2022-06-28 at 1 37 55 PM

result:
Screen Shot 2022-06-28 at 1 39 47 PM

@jxxl998
Copy link

jxxl998 commented Jul 11, 2023

set style diaplay: flex; works either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests