xianniu-ui 0.6.4 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xianniu-ui",
3
- "version": "0.6.4",
3
+ "version": "0.7.1",
4
4
  "private": false,
5
5
  "main": "lib/xianniu-ui.umd.min.js",
6
6
  "scripts": {
@@ -0,0 +1,7 @@
1
+ import XnCard from './main.vue'
2
+
3
+ XnCard.install = function (Vue) {
4
+ Vue.component(XnCard.name, XnCard)
5
+ }
6
+
7
+ export default XnCard
@@ -0,0 +1,47 @@
1
+ <template>
2
+ <div class="xn-card">
3
+ <div class="xn-card-header flex justify-content-between">
4
+ <slot name="title" v-if="title || $slots.title">
5
+ <slot name="title">
6
+ <h3><span>{{title}}</span></h3>
7
+ </slot>
8
+ </slot>
9
+ <div class="xn-card-header__more">
10
+ <slot name="more"></slot>
11
+ </div>
12
+ </div>
13
+ <div class="xn-card-body" :style="styles">
14
+ <slot></slot>
15
+ </div>
16
+ </div>
17
+ </template>
18
+
19
+ <script>
20
+ export default {
21
+ name: "XnCard",
22
+ props: {
23
+ title: {
24
+ type: String,
25
+ default: "",
26
+ },
27
+ bodyStyle: {
28
+ type: Object,
29
+ default: () => {
30
+ return {
31
+ padding: "18px",
32
+ };
33
+ },
34
+ },
35
+ },
36
+ computed: {
37
+ styles() {
38
+ return {
39
+ ...this.bodyStyle,
40
+ };
41
+ },
42
+ },
43
+ };
44
+ </script>
45
+
46
+ <style>
47
+ </style>
@@ -1,6 +1,13 @@
1
1
  <template>
2
2
  <div class="xn-search">
3
- <el-form ref="form" inline :model="form" :label-width="labelWidth">
3
+ <el-form
4
+ ref="form"
5
+ inline
6
+ :model="form"
7
+ :label-width="labelWidth"
8
+ @submit.native.prevent
9
+ @keyup.enter.native="onSearch"
10
+ >
4
11
  <el-row :gutter="0" class="xn-search--row">
5
12
  <template v-for="(item, idx) in form.value">
6
13
  <el-col v-bind="{ ...col }" :key="idx" v-show="item.isShow || isColl">
@@ -16,6 +23,7 @@
16
23
  :data-level="(item.options && item.options.dataLevel) || 2"
17
24
  v-model="item.modelVal"
18
25
  @on-city="handleChangeCity"
26
+
19
27
  />
20
28
  </el-form-item>
21
29
  <el-form-item
@@ -53,6 +61,7 @@
53
61
  :reserve-keyword="isRemote(item.remote)"
54
62
  :default-first-option="isRemote(item.remote)"
55
63
  :remote-method="item.remote"
64
+
56
65
  >
57
66
  <el-option
58
67
  v-for="(itemData, idxData) in item.data"
@@ -302,12 +311,12 @@ export default {
302
311
  setValue(key, value) {
303
312
  if (Object.prototype.toString.call(key) === "[object Object]") {
304
313
  const list = this.form.value;
305
- const keys = Object.keys(key)
314
+ const keys = Object.keys(key);
306
315
  for (let i = 0; i < list.length; i++) {
307
316
  const item = list[i];
308
- if(keys.includes(item.prop)){
309
- console.log(item,key[item.prop]);
310
- item.modelVal = key[item.prop]
317
+ if (keys.includes(item.prop)) {
318
+ console.log(item, key[item.prop]);
319
+ item.modelVal = key[item.prop];
311
320
  }
312
321
  }
313
322
  return;
@@ -0,0 +1,16 @@
1
+ .xn-card {
2
+ background-color: #fff;
3
+ padding: 0 38px;
4
+ &-header {
5
+ padding: 24px 0 13px 0;
6
+ border-bottom: 1px solid #f2f2f2;
7
+ h3 {
8
+ margin: 0;
9
+ padding: 0;
10
+ font-size: 18px;
11
+ font-weight: 500;
12
+ color: #202131;
13
+ line-height: 25px;
14
+ }
15
+ }
16
+ }
@@ -12,6 +12,7 @@
12
12
  @import './footer.scss';
13
13
  @import './tag.scss';
14
14
  @import './ellipsis.scss';
15
+ @import './card.scss';
15
16
 
16
17
 
17
18
 
@@ -19,4 +20,5 @@
19
20
  @import './theme/variables.scss';
20
21
  @import './theme/mixin.scss';
21
22
  @import './theme/transition.scss';
22
- @import './theme/sidebar.scss';
23
+ @import './theme/sidebar.scss';
24
+ @import './theme/element-ui.scss';
@@ -0,0 +1,8 @@
1
+ .el-descriptions{
2
+ .el-descriptions-item__label:not(.is-bordered-label){
3
+ color: #909097;
4
+ }
5
+ &--small{
6
+ font-size: 14px;
7
+ }
8
+ }
@@ -116,7 +116,7 @@
116
116
  </el-table-column>
117
117
  <el-table-column
118
118
  width="50px"
119
- label="No."
119
+ label="序号"
120
120
  v-if="index && data.length"
121
121
  type="index"
122
122
  ></el-table-column>
@@ -61,7 +61,7 @@ export default {
61
61
  if (
62
62
  data.parentId &&
63
63
  data.parentId !== 0 &&
64
- !data[this.defaultProps.children].length
64
+ (data[this.defaultProps.children] && !data[this.defaultProps.children].length)
65
65
  ) {
66
66
  className = 'especially'
67
67
  }
package/src/index.js CHANGED
@@ -15,6 +15,7 @@ import XnFooter from '../packages/footer/index'
15
15
  import XnEmpty from '../packages/empty/index'
16
16
  import XnTag from '../packages/tag/index'
17
17
  import XnEllipsis from '../packages/ellipsis/index'
18
+ import XnCard from '../packages/card/index'
18
19
 
19
20
  import Utils from 'xn-ui/src/utils/index'
20
21
  const doc = 'http://lzwr.gitee.io/xn-ui/#/'
@@ -34,7 +35,8 @@ const components = [
34
35
  XnFooter,
35
36
  XnEmpty,
36
37
  XnTag,
37
- XnEllipsis
38
+ XnEllipsis,
39
+ XnCard
38
40
  ]
39
41
  const version = require('../package.json').version
40
42
  const install = function (Vue) {
@@ -80,5 +82,6 @@ export default {
80
82
  XnFooter,
81
83
  XnEmpty,
82
84
  XnTag,
83
- XnEllipsis
85
+ XnEllipsis,
86
+ XnCard
84
87
  }