Skip to content

Fix/#2516 #2573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions components/input/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ describe('Input', () => {
focusTest(TextArea);
focusTest(Password);

it('should support maxLength', async () => {
const wrapper = mount(Input, { attrs: { maxLength: 3 }, sync: false });
await asyncExpect(() => {
expect(wrapper.html()).toMatchSnapshot();
}, 0);
});
it('select()', () => {
const wrapper = mount(Input);
wrapper.vm.select();
Expand Down Expand Up @@ -62,13 +56,6 @@ describe('TextArea', () => {
expect(wrapper.html()).toMatchSnapshot();
});
});

it('should support maxLength', async () => {
const wrapper = mount(TextArea, { attrs: { maxLength: 10 }, sync: false });
await asyncExpect(() => {
expect(wrapper.html()).toMatchSnapshot();
});
});
});

describe('As Form Control', () => {
Expand Down
1 change: 0 additions & 1 deletion components/input/inputProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export default {
default: true,
type: Boolean,
},
maxLength: PropTypes.number,
loading: PropTypes.bool,
className: PropTypes.string,
};
89 changes: 55 additions & 34 deletions examples/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,45 @@
中文
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

无关的就不要提了

</a-radio-button>
</a-radio-group>
<div><h4>v-model: <input v-model="color" type="text"></h4><a-color-picker v-model="color" style="width:130px" @show="changeHandler" /></div>
<div><h4>v-model:{{ color }}</h4><a-color-picker v-model="color" style="width:130px" @show="changeHandler" /></div>
<div><h4>备选颜色</h4><a-color-picker :config="config1" /></div>
<div><h4>多种输入格式</h4><a-color-picker :config="config2" :get-popup-container="node=>node.parentNode" /></div>
<div>
<h4>v-model: <input v-model="color" type="text" /></h4>
<a-color-picker v-model="color" style="width:130px" @show="changeHandler" />
</div>
<div>
<h4>v-model:{{ color }}</h4>
<a-color-picker v-model="color" style="width:130px" @show="changeHandler" />
</div>
<div>
<h4>备选颜色</h4>
<a-color-picker :config="config1" />
</div>
<div>
<h4>多种输入格式</h4>
<a-color-picker :config="config2" :get-popup-container="node => node.parentNode" />
</div>
<div>
<button @click="config2.components.preview = !config2.components.preview">
修改config
</button>
</div>
<div><h4>多种尺寸</h4><a-color-picker size="large" /></div>
<div>
<h4>多种尺寸</h4>
<a-color-picker size="large" />
</div>
<div><a-color-picker size="small" /></div>
<div><h4>切换禁用</h4><a-color-picker :disabled="disabled" /></div>
<div>
<h4>切换禁用</h4>
<a-color-picker :disabled="disabled" />
</div>
<div>
<button @click="disabled = !disabled">
切换
</button>
</div>
<div><h4>切换格式 [color:{{ color2 }}]</h4><a-color-picker v-model="color2" :locale="zhCN" :format="format" /></div>
<div>
<h4>切换格式 [color:{{ color2 }}]</h4>
<a-color-picker v-model="color2" :locale="zhCN" :format="format" />
</div>
<div>
<button @click="format = 'HEX'">
HEX
Expand All @@ -53,16 +74,16 @@ import enUS from 'ant-design-vue/../components/locale/en_US';
import zhCN from 'ant-design-vue/../components/locale/zh_CN';
export default {
name: 'Demo',
data () {
data() {
return {
color:'#ccc',
color2:'#ccc',
disabled:false,
format:'',
color: '#ccc',
color2: '#ccc',
disabled: false,
format: '',
locale: enUS,
enUS,
zhCN,
config1:{
config1: {
swatches: [
'rgba(244, 67, 54, 1)',
'rgba(233, 30, 99, 0.95)',
Expand All @@ -78,35 +99,35 @@ export default {
'rgba(205, 220, 57, 0.9)',
'rgba(255, 235, 59, 0.95)',
'rgba(255, 193, 7, 1)',
],
],
},
config2:{
config2: {
components: {
// Main components
preview: true,
opacity: true,
hue: true,
preview: true,
opacity: true,
hue: true,
interaction: {
hex: true,
rgba: true,
hsla: true,
hsva: true,
cmyk: true,
input: true,
clear: true,
save: true,
},
strings: {
save: 'Save',
clear: 'Clear',
cancel: 'Cancel',
},
hex: true,
rgba: true,
hsla: true,
hsva: true,
cmyk: true,
input: true,
clear: true,
save: true,
},
strings: {
save: 'Save',
clear: 'Clear',
cancel: 'Cancel',
},
},
},
};
},
methods:{
changeHandler(...arg){
methods: {
changeHandler(...arg) {
arg;
// console.log(arg);
},
Expand Down