2021-12-30 00:44:43 +08:00
|
|
|
::: anchor
|
|
|
|
:::
|
|
|
|
|
2021-10-26 01:13:23 +08:00
|
|
|
::: title 基础使用
|
2021-10-24 21:31:42 +08:00
|
|
|
:::
|
|
|
|
|
2021-10-13 13:10:37 +08:00
|
|
|
::: demo
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<lay-form>
|
|
|
|
<lay-radio v-model="selected1" name="action" label="1">写作</lay-radio>
|
|
|
|
<lay-radio v-model="selected1" name="action" label="2">画画</lay-radio>
|
|
|
|
<lay-radio v-model="selected1" name="action" label="3">运动</lay-radio>
|
|
|
|
</lay-form>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
setup() {
|
|
|
|
|
|
|
|
const selected1 = ref("1");
|
|
|
|
|
|
|
|
return {
|
2021-10-15 14:27:58 +08:00
|
|
|
selected1
|
2021-10-13 13:10:37 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
2021-10-26 01:13:23 +08:00
|
|
|
::: title 禁用状态
|
2021-10-24 21:31:42 +08:00
|
|
|
:::
|
|
|
|
|
2021-10-13 13:10:37 +08:00
|
|
|
::: demo
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<lay-form>
|
|
|
|
<lay-radio v-model="selected2" name="action" label="1">写作</lay-radio>
|
|
|
|
<lay-radio v-model="selected2" name="action" label="2">画画</lay-radio>
|
|
|
|
<lay-radio v-model="selected2" name="action" label="3">运动</lay-radio>
|
|
|
|
<lay-radio v-model="selected2" name="action" label="4" :disabled="disabled">禁用</lay-radio>
|
|
|
|
</lay-form>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
setup() {
|
|
|
|
|
|
|
|
const disabled = ref(true);
|
|
|
|
const selected2 = ref("1");
|
|
|
|
|
|
|
|
return {
|
|
|
|
disabled,
|
|
|
|
selected2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
2021-10-26 01:13:23 +08:00
|
|
|
::: title 事件回调
|
2021-10-24 21:31:42 +08:00
|
|
|
:::
|
|
|
|
|
2021-10-13 13:10:37 +08:00
|
|
|
::: demo
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<lay-form>
|
|
|
|
<lay-radio v-model="selected3" name="action" label="1" @change="change">写作</lay-radio>
|
|
|
|
<lay-radio v-model="selected3" name="action" label="2" @change="change">画画</lay-radio>
|
|
|
|
<lay-radio v-model="selected3" name="action" label="3" @change="change">运动</lay-radio>
|
|
|
|
</lay-form>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
setup() {
|
|
|
|
|
|
|
|
const selected3 = ref("1");
|
|
|
|
const change = function( current ) {
|
|
|
|
console.log("当前值:" + current)
|
|
|
|
}
|
|
|
|
return {
|
|
|
|
selected3,
|
|
|
|
change
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2021-10-13 14:13:04 +08:00
|
|
|
:::
|
|
|
|
|
2022-01-10 01:17:03 +08:00
|
|
|
::: title Radio 属性
|
2021-10-24 21:31:42 +08:00
|
|
|
:::
|
|
|
|
|
2021-11-07 15:55:08 +08:00
|
|
|
::: table
|
|
|
|
|
2021-11-01 01:02:21 +08:00
|
|
|
| 属性 | 描述 | 默认值 |
|
|
|
|
| ------- | ------------- | ------ |
|
|
|
|
| name | 原始属性 name | -- |
|
|
|
|
| label | 当前值 | -- |
|
|
|
|
| v-model | 选中值 | -- |
|
|
|
|
|
2021-11-07 15:55:08 +08:00
|
|
|
:::
|
|
|
|
|
2022-01-10 01:17:03 +08:00
|
|
|
::: title Radio 事件
|
2021-11-01 01:02:21 +08:00
|
|
|
:::
|
|
|
|
|
2021-11-07 15:55:08 +08:00
|
|
|
::: table
|
|
|
|
|
2021-11-01 01:02:21 +08:00
|
|
|
| 事件 | 描述 | 参数 |
|
|
|
|
| ------ | -------- | ---------------- |
|
|
|
|
| change | 切换事件 | current : 当前值 |
|
2021-11-07 15:55:08 +08:00
|
|
|
|
2021-11-07 15:56:24 +08:00
|
|
|
:::
|
2021-12-16 17:57:59 +08:00
|
|
|
|
|
|
|
::: comment
|
2022-01-12 14:19:06 +08:00
|
|
|
:::
|
|
|
|
|
|
|
|
::: previousNext radio
|
2021-12-16 17:57:59 +08:00
|
|
|
:::
|