换ubuntu
This commit is contained in:
2
utils/dist/radio/index.d.ts
vendored
2
utils/dist/radio/index.d.ts
vendored
@@ -1 +1 @@
|
||||
export {};
|
||||
export {};
|
||||
|
||||
120
utils/dist/radio/index.js
vendored
120
utils/dist/radio/index.js
vendored
@@ -1,60 +1,60 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
import { addUnit } from '../common/utils';
|
||||
VantComponent({
|
||||
field: true,
|
||||
relation: {
|
||||
name: 'radio-group',
|
||||
type: 'ancestor',
|
||||
linked(target) {
|
||||
this.parent = target;
|
||||
},
|
||||
unlinked() {
|
||||
this.parent = null;
|
||||
}
|
||||
},
|
||||
classes: ['icon-class', 'label-class'],
|
||||
props: {
|
||||
value: null,
|
||||
disabled: Boolean,
|
||||
useIconSlot: Boolean,
|
||||
checkedColor: String,
|
||||
labelPosition: {
|
||||
type: String,
|
||||
value: 'right'
|
||||
},
|
||||
labelDisabled: Boolean,
|
||||
shape: {
|
||||
type: String,
|
||||
value: 'round'
|
||||
},
|
||||
iconSize: {
|
||||
type: null,
|
||||
observer: 'setIconSizeUnit'
|
||||
}
|
||||
},
|
||||
data: {
|
||||
iconSizeWithUnit: '20px'
|
||||
},
|
||||
methods: {
|
||||
setIconSizeUnit(val) {
|
||||
this.setData({
|
||||
iconSizeWithUnit: addUnit(val)
|
||||
});
|
||||
},
|
||||
emitChange(value) {
|
||||
const instance = this.parent || this;
|
||||
instance.$emit('input', value);
|
||||
instance.$emit('change', value);
|
||||
},
|
||||
onChange(event) {
|
||||
console.log(event);
|
||||
this.emitChange(this.data.name);
|
||||
},
|
||||
onClickLabel() {
|
||||
const { disabled, labelDisabled, name } = this.data;
|
||||
if (!disabled && !labelDisabled) {
|
||||
this.emitChange(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
import { VantComponent } from '../common/component';
|
||||
import { addUnit } from '../common/utils';
|
||||
VantComponent({
|
||||
field: true,
|
||||
relation: {
|
||||
name: 'radio-group',
|
||||
type: 'ancestor',
|
||||
linked(target) {
|
||||
this.parent = target;
|
||||
},
|
||||
unlinked() {
|
||||
this.parent = null;
|
||||
}
|
||||
},
|
||||
classes: ['icon-class', 'label-class'],
|
||||
props: {
|
||||
value: null,
|
||||
disabled: Boolean,
|
||||
useIconSlot: Boolean,
|
||||
checkedColor: String,
|
||||
labelPosition: {
|
||||
type: String,
|
||||
value: 'right'
|
||||
},
|
||||
labelDisabled: Boolean,
|
||||
shape: {
|
||||
type: String,
|
||||
value: 'round'
|
||||
},
|
||||
iconSize: {
|
||||
type: null,
|
||||
observer: 'setIconSizeUnit'
|
||||
}
|
||||
},
|
||||
data: {
|
||||
iconSizeWithUnit: '20px'
|
||||
},
|
||||
methods: {
|
||||
setIconSizeUnit(val) {
|
||||
this.setData({
|
||||
iconSizeWithUnit: addUnit(val)
|
||||
});
|
||||
},
|
||||
emitChange(value) {
|
||||
const instance = this.parent || this;
|
||||
instance.$emit('input', value);
|
||||
instance.$emit('change', value);
|
||||
},
|
||||
onChange(event) {
|
||||
console.log(event);
|
||||
this.emitChange(this.data.name);
|
||||
},
|
||||
onClickLabel() {
|
||||
const { disabled, labelDisabled, name } = this.data;
|
||||
if (!disabled && !labelDisabled) {
|
||||
this.emitChange(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
12
utils/dist/radio/index.json
vendored
12
utils/dist/radio/index.json
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-icon": "../icon/index"
|
||||
}
|
||||
}
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-icon": "../icon/index"
|
||||
}
|
||||
}
|
||||
|
||||
58
utils/dist/radio/index.wxml
vendored
58
utils/dist/radio/index.wxml
vendored
@@ -1,29 +1,29 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
|
||||
<view class="van-radio custom-class">
|
||||
<view
|
||||
wx:if="{{ labelPosition === 'left' }}"
|
||||
class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}"
|
||||
bindtap="onClickLabel"
|
||||
>
|
||||
<slot />
|
||||
</view>
|
||||
<view class="van-radio__icon-wrap" style="font-size: {{ iconSizeWithUnit }};" bindtap="onChange">
|
||||
<slot wx:if="{{ useIconSlot }}" name="icon" />
|
||||
<van-icon
|
||||
wx:else
|
||||
name="success"
|
||||
class="{{ utils.bem('radio__icon', [shape, { disabled, checked: value === name }]) }}"
|
||||
style="{{ checkedColor && !disabled && value === name ? 'border-color:' + checkedColor + '; background-color:' + checkedColor + ';' : '' }}"
|
||||
custom-class="icon-class"
|
||||
custom-style="line-height: {{ iconSizeWithUnit }};font-size: .8em;display: block;"
|
||||
/>
|
||||
</view>
|
||||
<view
|
||||
wx:if="{{ labelPosition === 'right' }}"
|
||||
class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}"
|
||||
bindtap="onClickLabel"
|
||||
>
|
||||
<slot />
|
||||
</view>
|
||||
</view>
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
|
||||
<view class="van-radio custom-class">
|
||||
<view
|
||||
wx:if="{{ labelPosition === 'left' }}"
|
||||
class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}"
|
||||
bindtap="onClickLabel"
|
||||
>
|
||||
<slot />
|
||||
</view>
|
||||
<view class="van-radio__icon-wrap" style="font-size: {{ iconSizeWithUnit }};" bindtap="onChange">
|
||||
<slot wx:if="{{ useIconSlot }}" name="icon" />
|
||||
<van-icon
|
||||
wx:else
|
||||
name="success"
|
||||
class="{{ utils.bem('radio__icon', [shape, { disabled, checked: value === name }]) }}"
|
||||
style="{{ checkedColor && !disabled && value === name ? 'border-color:' + checkedColor + '; background-color:' + checkedColor + ';' : '' }}"
|
||||
custom-class="icon-class"
|
||||
custom-style="line-height: {{ iconSizeWithUnit }};font-size: .8em;display: block;"
|
||||
/>
|
||||
</view>
|
||||
<view
|
||||
wx:if="{{ labelPosition === 'right' }}"
|
||||
class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}"
|
||||
bindtap="onClickLabel"
|
||||
>
|
||||
<slot />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user