element icon indicating copy to clipboard operation
element copied to clipboard

radio 无法绑定number

Open callmesoul opened this issue 9 years ago • 4 comments

radio 无法绑定number

callmesoul avatar Feb 15 '17 07:02 callmesoul

请给 demo

Leopoldthecoder avatar Feb 15 '17 09:02 Leopoldthecoder

@Leopoldthecoder radio绑定数字上我发现这样一个问题:对radio绑定数字,model 为radioValue=‘1’,需要是字符串,但是在radio-group中,model为 radioValue2=1,需要是number。不是很统一,不知道设计目的是怎样的。源码radio.vue文件中radio class中有i 'is-checked': model === label,‘===’判断,类型不同则is-ckecked属性不能为true

bulaye avatar Feb 16 '17 01:02 bulaye

@bulaye 没看懂你的意思,radio 和 radio-group 都是既可以绑定数字又可以绑定字符串的。

Leopoldthecoder avatar Feb 16 '17 02:02 Leopoldthecoder

@Leopoldthecoder 又试了一下,发现自己搞错了 只考虑radio绑定数字的情况,如果写 :label = “3” (label有冒号)则 data中 radiio:1 (number),如果写 label="1"(label前没有冒号)则data中radio:‘1’(string),是不是这样?

bulaye avatar Feb 17 '17 12:02 bulaye