docs: change slot to # (#5858)
* docs(SwipeCell): change "slot" to "v-slot" * docs(SwipeCell): change `v-slot` to`#` * docs(cell): change `slot` to `#` * docs(checkbox): change `slot` to `v-slot` * docs(field): change `slot` to `v-slot` * docs(checkbox): remove wrong comment * docs(radio): change `slot` to `#` * docs(search): change `slot` to `#` * docs(slider): change `slot` to `#` * docs(switch): change `slot` to `#` * docs(PullRefresh): change `slot` to `#` * docs(collapse): change `slot` to `#` * docs(panel): change `slot` to `#` * docs(swipe): change `slot` to `#` * docs(navbar): change `slot` to `#` * docs(tab): change `slot` to `#` * docs(tabber): change `slot` to `#` * docs(TreeSelect): change `slot` to `#` * docs(card): change `slot` to `#` * docs(submitBar): change `slot` to `#` * docs(sku): change `slot` to `#` unsure * docs(cell): delete waste blank line * docs(panel): fix indentation * docs(PullRefresh): change "count" to "Refresh Count" * docs(radio): delete waste blank line * docs(search): move props above the event * docs(submitBar): delete waste `<span>` * docs(swipCell): delete waste blank line * docs(tabbar): merge `<img>` into one line
This commit is contained in:
+24
-12
@@ -86,21 +86,29 @@ Use icon slot to custom icon
|
||||
<van-radio-group v-model="radio">
|
||||
<van-radio name="1">
|
||||
Radio 1
|
||||
<img
|
||||
slot="icon"
|
||||
slot-scope="props"
|
||||
:src="props.checked ? activeIcon : inactiveIcon"
|
||||
>
|
||||
<template #icon="props">
|
||||
<img
|
||||
class="img-icon"
|
||||
:src="props.checked ? activeIcon : inactiveIcon"
|
||||
>
|
||||
</template>
|
||||
</van-radio>
|
||||
<van-radio name="2">
|
||||
Radio 2
|
||||
<img
|
||||
slot="icon"
|
||||
slot-scope="props"
|
||||
:src="props.checked ? activeIcon : inactiveIcon"
|
||||
>
|
||||
<template #icon="props">
|
||||
<img
|
||||
class="img-icon"
|
||||
:src="props.checked ? activeIcon : inactiveIcon"
|
||||
/>
|
||||
</template>
|
||||
</van-radio>
|
||||
</van-radio-group>
|
||||
|
||||
<style>
|
||||
.img-icon {
|
||||
height: 20px;
|
||||
}
|
||||
</style>>
|
||||
```
|
||||
|
||||
```js
|
||||
@@ -130,10 +138,14 @@ export default {
|
||||
<van-radio-group v-model="radio">
|
||||
<van-cell-group>
|
||||
<van-cell title="Radio 1" clickable @click="radio = '1'">
|
||||
<van-radio slot="right-icon" name="1" />
|
||||
<template #right-icon>
|
||||
<van-radio name="1" />
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell title="Radio 2" clickable @click="radio = '2'">
|
||||
<van-radio slot="right-icon" name="2" />
|
||||
<template #right-icon>
|
||||
<van-radio name="2" />
|
||||
</template>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</van-radio-group>
|
||||
|
||||
+29
-15
@@ -96,29 +96,39 @@ export default {
|
||||
<van-radio-group v-model="radio">
|
||||
<van-radio name="1">
|
||||
单选框 1
|
||||
<img
|
||||
slot="icon"
|
||||
slot-scope="props"
|
||||
:src="props.checked ? activeIcon : inactiveIcon"
|
||||
>
|
||||
<template #icon="props">
|
||||
<img
|
||||
class="img-icon"
|
||||
:src="props.checked ? activeIcon : inactiveIcon"
|
||||
>
|
||||
</template>
|
||||
</van-radio>
|
||||
<van-radio name="2">
|
||||
单选框 2
|
||||
<img
|
||||
slot="icon"
|
||||
slot-scope="props"
|
||||
:src="props.checked ? activeIcon : inactiveIcon"
|
||||
>
|
||||
<template #icon="props">
|
||||
<img
|
||||
class="img-icon"
|
||||
:src="props.checked ? activeIcon : inactiveIcon"
|
||||
/>
|
||||
</template>
|
||||
</van-radio>
|
||||
</van-radio-group>
|
||||
|
||||
<style>
|
||||
.img-icon {
|
||||
height: 20px;
|
||||
}
|
||||
</style>
|
||||
```
|
||||
|
||||
```js
|
||||
export default {
|
||||
data() {
|
||||
radio: '1',
|
||||
activeIcon: 'https://img.yzcdn.cn/vant/user-active.png',
|
||||
inactiveIcon: 'https://img.yzcdn.cn/vant/user-inactive.png'
|
||||
return {
|
||||
radio: '1',
|
||||
activeIcon: 'https://img.yzcdn.cn/vant/user-active.png',
|
||||
inactiveIcon: 'https://img.yzcdn.cn/vant/user-inactive.png'
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -142,10 +152,14 @@ export default {
|
||||
<van-radio-group v-model="radio">
|
||||
<van-cell-group>
|
||||
<van-cell title="单选框 1" clickable @click="radio = '1'">
|
||||
<van-radio slot="right-icon" name="1" />
|
||||
<template #right-icon>
|
||||
<van-radio name="1" />
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell title="单选框 2" clickable @click="radio = '2'">
|
||||
<van-radio slot="right-icon" name="2" />
|
||||
<template #right-icon>
|
||||
<van-radio name="2" />
|
||||
</template>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</van-radio-group>
|
||||
|
||||
Reference in New Issue
Block a user