vue实现性别选择框

删除回忆录丶 提交于 2020-01-21 00:30:49

简单的实现了vue2.0移动端自定义性别选择的功能,一个小的demo

<template>    <div class="app">                <div class="boy">        <input type="radio" name="radios" value="1" v-model="param"><label>男</label>        </div>                <div class="girl">        <input type="radio" name="radios" value="2" v-model="param"><label>女</label>        </div>            </div></template><script>    export default {        data() {            return {                param: '1' //设置默认值为1,即设置第一个单选框为选中状态             }        },        methods: {         }    };</script> <style>    .app{    height:60px;    background: #fff;       border: 1px solid  #f1ebeb;    }    .boy{    height:30px;    background: fff;    border-bottom: 1px solid  #f1ebeb;    }    .boy input{        text-align: center;    }    .boy label{        text-align: center;    }            .girl{        height:30px;    background: fff;    }</style>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!