1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <template>
- <view class="u-th" :style="[thStyle]">
- <slot></slot>
- </view>
- </template>
- <script>
-
- export default {
- name: "u-th",
- props: {
-
- width: {
- type: [Number, String],
- default: ''
- }
- },
- data() {
- return {
- thStyle: {}
- }
- },
- created() {
- this.parent = false;
- },
- mounted() {
- this.parent = this.$u.$parent.call(this, 'u-table');
- if (this.parent) {
-
- let style = {};
- if (this.width) style.flex = `0 0 ${this.width}`;
- style.textAlign = this.parent.align;
- style.padding = this.parent.padding;
- style.borderBottom = `solid 1px ${this.parent.borderColor}`;
- style.borderRight = `solid 1px ${this.parent.borderColor}`;
- Object.assign(style, this.parent.style);
- this.thStyle = style;
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- @import "../../libs/css/style.components.scss";
- .u-th {
- @include vue-flex;
- flex-direction: column;
- flex: 1;
- justify-content: center;
- font-size: 28rpx;
- color: $u-main-color;
- font-weight: bold;
- background-color: rgb(245, 246, 248);
- }
- </style>
|