|
2 | 2 | from="./index.sjs" |
3 | 3 | name="componentUtils" /> |
4 | 4 |
|
5 | | -<template name="checkbox-item"> |
6 | | - <view class="ant-checkbox-item-container"> |
7 | | - <view class="ant-checkbox-item-wrap"> |
8 | | - <!-- #if WECHAT --> |
9 | | - <checkbox-group bindchange="onChange"> |
10 | | - <checkbox |
11 | | - class="ant-checkbox-item-base" |
12 | | - value="{{ value }}" |
13 | | - checked="{{ mixin.value }}" |
14 | | - disabled="{{ disabled }}" /> |
15 | | - </checkbox-group> |
16 | | - <!-- #endif --> |
17 | | - <!-- #if ALIPAY --> |
| 5 | +<template name="checkbox"> |
| 6 | + <view class="ant-checkbox-item-wrap"> |
| 7 | + <!-- #if WECHAT --> |
| 8 | + <checkbox-group bindchange="onChange"> |
18 | 9 | <checkbox |
19 | 10 | class="ant-checkbox-item-base" |
20 | 11 | value="{{ value }}" |
21 | | - onChange="onChange" |
22 | 12 | checked="{{ mixin.value }}" |
23 | 13 | disabled="{{ disabled }}" /> |
24 | | - <!-- #endif --> |
25 | | - <view class="ant-checkbox-item-fake"> |
26 | | - <view |
27 | | - class="ant-checkbox-item-fake-{{ componentUtils.getClassName(mixin.value, disabled) }}" |
28 | | - style="{{ mixin.value && !disabled && color ? 'background:' + color : '' }}"> |
29 | | - <ant-icon |
30 | | - a:if="{{ mixin.value }}" |
31 | | - type="CheckOutline" |
32 | | - className="ant-checkbox-item-fake-{{ componentUtils.getClassName(mixin.value, disabled) }}-icon" /> |
33 | | - </view> |
| 14 | + </checkbox-group> |
| 15 | + <!-- #endif --> |
| 16 | + <!-- #if ALIPAY --> |
| 17 | + <checkbox |
| 18 | + class="ant-checkbox-item-base" |
| 19 | + value="{{ value }}" |
| 20 | + onChange="onChange" |
| 21 | + checked="{{ mixin.value }}" |
| 22 | + disabled="{{ disabled }}" /> |
| 23 | + <!-- #endif --> |
| 24 | + <view class="ant-checkbox-item-fake"> |
| 25 | + <view |
| 26 | + class="ant-checkbox-item-fake-{{ componentUtils.getClassName(mixin.value, disabled) }}" |
| 27 | + style="{{ mixin.value && !disabled && color ? 'background:' + color : '' }}"> |
| 28 | + <ant-icon |
| 29 | + a:if="{{ mixin.value }}" |
| 30 | + type="CheckOutline" |
| 31 | + className="ant-checkbox-item-fake-{{ componentUtils.getClassName(mixin.value, disabled) }}-icon" /> |
34 | 32 | </view> |
35 | 33 | </view> |
36 | | - <view |
37 | | - class="ant-checkbox-item-content {{ disabled ? 'ant-checkbox-item-disabled' : '' }}"> |
38 | | - <slot /> |
39 | | - </view> |
40 | 34 | </view> |
41 | 35 | </template> |
42 | 36 |
|
|
54 | 48 | style="{{ style || '' }}" |
55 | 49 | bindtap="onChange"> |
56 | 50 | <!-- #endif --> |
57 | | - <template |
58 | | - is="checkbox-item" |
59 | | - data="{{ |
60 | | - value, |
61 | | - mixin, |
62 | | - disabled, |
63 | | - color |
64 | | - }}" |
65 | | - /> |
| 51 | + <view class="ant-checkbox-item-container"> |
| 52 | + <template |
| 53 | + is="checkbox" |
| 54 | + data="{{ |
| 55 | + value, |
| 56 | + mixin, |
| 57 | + disabled, |
| 58 | + color |
| 59 | + }}" |
| 60 | + /> |
| 61 | + <view class="ant-checkbox-item-content {{ disabled ? 'ant-checkbox-item-disabled' : '' }}"> |
| 62 | + <slot /> |
| 63 | + </view> |
| 64 | + </view> |
66 | 65 | </label> |
67 | 66 | <view |
68 | 67 | a:else |
69 | 68 | class="ant-checkbox-item {{ className || '' }}" |
70 | 69 | style="{{ style || '' }}" |
71 | 70 | catchTap="onChange" |
72 | 71 | > |
73 | | - <template |
74 | | - is="checkbox-item" |
75 | | - data="{{ |
76 | | - value, |
77 | | - mixin, |
78 | | - disabled, |
79 | | - color |
80 | | - }}" |
81 | | - /> |
| 72 | + <view class="ant-checkbox-item-container"> |
| 73 | + <template |
| 74 | + is="checkbox" |
| 75 | + data="{{ |
| 76 | + value, |
| 77 | + mixin, |
| 78 | + disabled, |
| 79 | + color |
| 80 | + }}" |
| 81 | + /> |
| 82 | + <view class="ant-checkbox-item-content {{ disabled ? 'ant-checkbox-item-disabled' : '' }}"> |
| 83 | + <slot /> |
| 84 | + </view> |
| 85 | + </view> |
82 | 86 | </view> |
0 commit comments