Skip to content

Commit 38624a4

Browse files
committed
feat: init v3
1 parent c4e18e9 commit 38624a4

20 files changed

+1097
-405
lines changed

Diff for: demo/demo.vue

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<template>
2+
<div class="demo">
3+
<div>
4+
<checkbox v-model="isVertical" label="vertical">is vertical</checkbox>
5+
</div>
6+
<vue-filter-box
7+
v-model="value"
8+
loading
9+
:hidden-colon="false"
10+
:mode="isVertical ? 'vertical' : 'horizontal'"
11+
:rules="rules"
12+
:model="model"
13+
footer-one-line>
14+
<template v-slot:footer="{ validate, reset, validateField }">
15+
<div>
16+
<i-button @click="validate(onSubmit)">提交</i-button>
17+
<i-button @click="reset">重置</i-button>
18+
<i-button @click="validateField('roleType', onSubmit)">提交</i-button>
19+
</div>
20+
</template>
21+
</vue-filter-box>
22+
<div>
23+
<p>Select Value:</p>
24+
<pre>{{ value }}</pre>
25+
</div>
26+
</div>
27+
</template>
28+
29+
<script>
30+
import { Select, CheckboxGroup } from 'view-design';
31+
import { VueFilterBox } from '../packages/index';
32+
33+
export default {
34+
name: 'Demo',
35+
components: {
36+
VueFilterBox,
37+
},
38+
data() {
39+
return {
40+
isVertical: true,
41+
value: {},
42+
rules: {
43+
roleType: [{ required: true, message: 'qqq' }],
44+
},
45+
model: [
46+
{
47+
type: 'i-input',
48+
label: 'Search',
49+
key: 'keyword',
50+
rules: {
51+
required: true,
52+
message: 'This field is required',
53+
trigger: 'blur',
54+
},
55+
defaultValue: '123',
56+
props: {
57+
placeholder: 'ID / User Name',
58+
},
59+
},
60+
{
61+
type: 'iSelect', // iSelect ISelect
62+
label: 'Role Type',
63+
key: 'roleType',
64+
rules: {
65+
required: true,
66+
},
67+
props: {
68+
placeholder: 'Select Role type',
69+
},
70+
},
71+
{
72+
type: CheckboxGroup,
73+
label: 'Required',
74+
key: 'required',
75+
options: [
76+
{
77+
label: '1',
78+
value: '1',
79+
},
80+
{
81+
label: '2',
82+
value: '2',
83+
},
84+
{
85+
label: '2',
86+
value: '3',
87+
},
88+
{
89+
label: '2',
90+
value: '4',
91+
},
92+
],
93+
},
94+
{
95+
type: Select,
96+
label: 'Gender',
97+
key: 'gender',
98+
props: {
99+
placeholder: 'Select Gender',
100+
},
101+
options: [
102+
{
103+
label: '1',
104+
value: '1',
105+
}
106+
],
107+
},
108+
],
109+
};
110+
},
111+
methods: {
112+
onSubmit(valid) {
113+
console.log('valid', valid);
114+
}
115+
},
116+
}
117+
</script>
118+
119+
<style lang="less" scoped>
120+
.demo {
121+
padding: 10px;
122+
}
123+
</style>

Diff for: demo/main.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Vue from 'vue';
2+
import Demo from './demo.vue';
3+
import viewDesign, { Select } from 'view-design';
4+
import 'view-design/dist/styles/iview.css';
5+
6+
Vue.config.productionTip = false;
7+
Vue.use(viewDesign);
8+
9+
new Vue({
10+
render: h => h(Demo),
11+
}).$mount('#app');

0 commit comments

Comments
 (0)