当前位置:网站首页>006_ radio
006_ radio
2022-06-30 01:49:00 【Free and bound javajavascript】
1. Radio Radio buttons
1.1. Radio select from a set of alternatives .
1.2. Radio attribute
Parameters | explain | type | Optional value | The default value is |
value / v-model | Binding value | string / number / boolean | nothing | nothing |
label | Radio Of value | string / number / boolean | nothing | nothing |
disabled | Whether to disable | boolean | nothing | false |
border | Show border or not | boolean | nothing | false |
size | Radio box group size , Only for buttons Radio Or with a border Radio It works | string | medium / small / mini | nothing |
name | Native name attribute | string | nothing | nothing |
1.3. Radio event
Event name | explain | Callback Arguments |
change | Event triggered when the binding value changes | Selected Radio label value |
1.4. Radio-group attribute
Parameters | explain | type | Optional value | The default value is |
value / v-model | Binding value | string / number / boolean | nothing | nothing |
size | Radio box group size , Only for buttons Radio Or with a border Radio It works | string | medium / small / mini | nothing |
disabled | Whether to disable | boolean | nothing | false |
text-color | In the form of buttons Radio Text color when activated | string | nothing | #ffffff |
fill | In the form of buttons Radio Fill color and border color when active | string | nothing | #409EFF |
1.5. Radio-group event
Event name | explain | Callback Arguments |
change | Event triggered when the binding value changes | Selected Radio label value |
1.6. Radio-button attribute
Parameters | explain | type | Optional value | The default value is |
label | Radio Of value | string / number | nothing | nothing |
disabled | Whether to disable | boolean | nothing | false |
name | Native name attribute | string | nothing | nothing |
2. Radio Radio box example
2.1. Use the scaffold to create a new one named element-ui-radio Front end projects , At the same time to install Element plug-in unit .
2.2. To write App.vue
<template>
<div id="app">
<h1> Basic usage </h1>
<template>
<el-radio v-model="base_radio" label="1"> Options </el-radio>
<el-radio v-model="base_radio" label="2"> Options </el-radio>
</template>
<h1> Disabled state </h1>
<template>
<el-radio disabled v-model="disabled_radio" label=" Ban "> Options </el-radio>
<el-radio disabled v-model="disabled_radio" label=" Check and disable "> Options </el-radio>
</template>
<h1> Radio box group </h1>
<template>
<el-radio-group v-model="group_radio">
<el-radio :label="3"> Options </el-radio>
<el-radio :label="6"> Options </el-radio>
<el-radio :label="9"> Options </el-radio>
</el-radio-group>
</template>
<h1> Button style </h1>
<div>
<el-radio-group v-model="button_radio1" text-color="#F56C6C" fill="#67C23A">
<el-radio-button label=" Shanghai "></el-radio-button>
<el-radio-button label=" Beijing "></el-radio-button>
<el-radio-button label=" Guangzhou "></el-radio-button>
<el-radio-button label=" Shenzhen "></el-radio-button>
</el-radio-group>
</div>
<div style="margin-top: 20px">
<el-radio-group v-model="button_radio2" size="medium">
<el-radio-button label=" Shanghai " ></el-radio-button>
<el-radio-button label=" Beijing "></el-radio-button>
<el-radio-button label=" Guangzhou "></el-radio-button>
<el-radio-button label=" Shenzhen "></el-radio-button>
</el-radio-group>
</div>
<div style="margin-top: 20px">
<el-radio-group v-model="button_radio3" size="small">
<el-radio-button label=" Shanghai "></el-radio-button>
<el-radio-button label=" Beijing " disabled ></el-radio-button>
<el-radio-button label=" Guangzhou "></el-radio-button>
<el-radio-button label=" Shenzhen "></el-radio-button>
</el-radio-group>
</div>
<div style="margin-top: 20px">
<el-radio-group v-model="button_radio4" disabled size="mini">
<el-radio-button label=" Shanghai "></el-radio-button>
<el-radio-button label=" Beijing "></el-radio-button>
<el-radio-button label=" Guangzhou "></el-radio-button>
<el-radio-button label=" Shenzhen "></el-radio-button>
</el-radio-group>
</div>
<h1> With borders </h1>
<div>
<el-radio v-model="border_radio1" label="1" border> Options 1</el-radio>
<el-radio v-model="border_radio1" label="2" border> Options 2</el-radio>
</div>
<div style="margin-top: 20px">
<el-radio v-model="border_radio2" label="1" border size="medium"> Options 1</el-radio>
<el-radio v-model="border_radio2" label="2" border size="medium"> Options 2</el-radio>
</div>
<div style="margin-top: 20px">
<el-radio-group v-model="border_radio3" size="small">
<el-radio label="1" border> Options 1</el-radio>
<el-radio label="2" border disabled> Options 2</el-radio>
</el-radio-group>
</div>
<div style="margin-top: 20px">
<el-radio-group v-model="border_radio4" size="mini" disabled>
<el-radio label="1" border> Options 1</el-radio>
<el-radio label="2" border> Options 2</el-radio>
</el-radio-group>
</div>
</div>
</template>
<script>
export default {
data () {
return {
base_radio: '1',
disabled_radio: ' Check and disable ',
group_radio: 3,
button_radio1: ' Shanghai ',
button_radio2: ' Shanghai ',
button_radio3: ' Shanghai ',
button_radio4: ' Shanghai ',
border_radio1: '1',
border_radio2: '1',
border_radio3: '1',
border_radio4: '1'
}
}
}
</script>
2.3. Run the project
边栏推荐
猜你喜欢
【PyTorch实战】生成对抗网络GAN:生成动漫人物头像
Scala基础【入门及安装】
ES6 one line code for array de duplication
Application features and functions of painting Aquarium
什么是幂等性?四种接口幂等性方案详解!
Scala basics [introduction and installation]
首届技术播客月开播在即
Chiffrement des cookies 8
Is the processor the main factor in buying a mobile phone?
C语言 写出这个数
随机推荐
C language irony
Conjecture of prime pairs in C language
JS returned content is encoded by Unicode
Module import reload method
MySQL monitoring 3
C语言 一元多项式求导
Repair method for win10 subsystem WSL if the passwords of root and other users are forgotten
js Array.from()的5个便捷应用
Ctfshow competition original title 680-695
C语言 继续(3n+1)猜想
MySQL monitoring 2
Is the processor the main factor in buying a mobile phone?
Varnish 基础概览6
cookie加密11
Derivation of univariate polynomial in C language
App test related tools
Cookie encryption 8
搞透AQS原理(流程圖及同步隊列圖解)
工具与生活服务
C language I want to pass