123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <template>
- <div
- @click="(e) => $emit('click', e)"
- class="border-panel"
- :style="borderPanelStyle"
- >
- <div
- class="border-panel_header"
- :style="{
- backgroundImage: `url(${headerImageBgUrl})`,
- cursor: headerCursor
- }"
-
- >
- <linear-text
- :text="title"
- startColor="#95CCFF"
- endColor="#fff" @click="(e) => $emit('click-header', e)"
- :extClass="{
- top: '11px',
- left: '35px',
- textShadow: '0 1px 1px #0057FF',
- }"
- />
- <div class="ext-header"><slot name="ext-header"></slot></div>
- </div>
- <div class="border-panel_content">
- <slot></slot>
- </div>
- </div>
- </template>
- <script>
- import { headerTitleBgs } from "./data";
- import LinearText from "../LinearText";
- export default {
- name: "BorderPanel",
- components: {
- LinearText,
- },
- props: {
- title: {
- type: String,
- default: "标题",
- },
- width: {
- type: String,
- default: "443px",
- },
- height: {
- type: String,
- default: "200px",
- },
- headerType: {
- type: Number,
- default: 0,
- },
- headerCursor: {
- type: String,
- default: 'default'
- }
- },
- computed: {
- borderPanelStyle: function () {
- return {
- "--height": this.$props.height,
- "--width": this.$props.width,
- "--header-ops": ["-4px", "0px", "0px"][this.$props.headerType],
- };
- },
- headerImageBgUrl: function () {
- console.log(this.headerType);
- return headerTitleBgs[this.$props.headerType];
- },
- },
- };
- </script>
- <style scoped lang="less">
- .border-panel {
- position: relative;
- height: var(
- width: var(
- box-sizing: border-box;
- overflow: hidden;
- background: linear-gradient(
- 360deg,
- rgba(0, 133, 255, 0.25) 0%,
- rgba(0, 163, 255, 0) 100%
- );
- }
- .border-panel_header {
- height: 50px;
- width: var(
- background-image: url("../assets/border-panel_header_1.svg");
- background-repeat: no-repeat;
- background-position: var(
- display: flex;
- justify-content: space-between;
- .ext-header {
- margin-right: 15px;
- margin-top: 12px;
- }
- }
- .border-panel::after {
- content: "";
- position: absolute;
- top: 0px;
- left: 0px;
- padding: 1px;
- box-sizing: border-box;
- width: var(
- height: var(
- background: linear-gradient(360deg, #0c5a87 0%, rgba(0, 163, 255, 0) 100%);
-
-
-
-
-
- -webkit-mask-image: var(
-
- -webkit-mask-origin: var(
-
- -webkit-mask-clip: var(
-
- mask-composite: exclude;
-
- -webkit-mask-composite: destination-out;
- pointer-events: none;
- }
- .border-panel_content {
- padding: 0px 1px 0px 1px;
- }
- </style>
|