Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 如何通过单击vue.js中单选按钮来绑定其值';s标签?_Css_Vue.js_Radio Button - Fatal编程技术网

Css 如何通过单击vue.js中单选按钮来绑定其值';s标签?

Css 如何通过单击vue.js中单选按钮来绑定其值';s标签?,css,vue.js,radio-button,Css,Vue.js,Radio Button,是否有方法单击收音机输入的标签以输出值 我在vue.js中使用v-model,并且我隐藏了我的单选按钮(input[type=“radio”]{display:none;),我试图使用按钮的值,但是当我单击标签时,它不起作用 jsIDLE:单选按钮必须具有相同的名称,以便将其视为单个单选组。此外,.for应参考相应的的id,以便单击标签将自动选择输入 您的模板应如下所示: 每日的 周报 月刊 每年 为所有输入赋予相同的名称 name="same" 为输入提供一个与标签“

是否有方法单击收音机输入的标签以输出值

我在vue.js中使用v-model,并且我隐藏了我的单选按钮(
input[type=“radio”]{display:none;
),我试图使用按钮的值,但是当我单击标签时,它不起作用


jsIDLE:

单选按钮必须具有相同的
名称
,以便将其视为单个单选组。此外,
.for
应参考相应的
id
,以便单击标签将自动选择输入

您的模板应如下所示:


每日的
周报
月刊
每年

为所有输入赋予相同的名称

name="same"
为输入提供一个与标签“
”相同的
id

<input id="daily" value="daily" v-model="checked" />
<label for="daily">Label</label>


每日的
周报
月刊
每年
value="daily"  // NOT :value="daily"
<input id="daily" type="radio" name="same" value="daily" v-model="checked">
<label for="daily">Daily</label>

<input id="weekly" type="radio" name="same" value="weekly" v-model="checked">
<label for="weekly">Weekly</label>

<input id="monthly" type="radio" name="same" value="monthly" v-model="checked">
<label for="monthly">Monthly</label>

<input id="yearly" type="radio" name="same" value="yearly" v-model="checked">
<label for="yearly">Yearly</label>