短视频源码,uniapp中单选框radio的实现

短视频源码,uniapp中单选框radio的实现

<radio-group @change="changeRadio" style="margin-left: 30rpx;">	
	<label v-for="item in identity" :key="item" style="margin-right: 20rpx;">
		<radio :value="item" :checked="item==radioValue" />{
    
    {
    
    item}}
	</label>
</radio-group>

export default {
    
    
		data() {
    
    
			return {
    
    
				radioValue:'',      //选中的value值
				identity:['学生','教师']
			};
		},
		methods: {
    
    
			changeRadio(e){
    
    
				this.radioValue = e.detail.value;
				console.log(this.radioValue);
			}
		}
	}

以上就是 短视频源码,uniapp中单选框radio的实现,更多内容欢迎关注之后的文章

猜你喜欢

转载自blog.csdn.net/yb1314111/article/details/124965319