123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <template>
- <span class="appley-btn" v-bind="$attrs" @click="btnClick">申请方案</span>
- </template>
- <script>
- export default {
- name: "applyBtn",
- props: {
- myType: {
- type: String,
- default: 'kaoshi'
- },
- },
- methods: {
- // 判断是否为移动端
- isPC() {
- const browserWidth = document.documentElement.clientWidth;
- if (browserWidth <= 768) {
- return false;
- } else {
- return true;
- }
- },
- btnClick() {
- if (this.isPC()) {
- this.$emit('active-pc', this.myType)
- } else {
- this.$emit('active-h5', this.myType);
- }
- }
- }
- }
- </script>
- <style lang="scss">
- .appley-btn{
- width: 154px;
- height: 48px;
- line-height: 48px;
- background: #00b96b;
- border-radius: 24px;
- color: #fff;
- cursor: pointer;
- display: inline-block;
- text-align: center;
- @media (max-width: 768px) {
- width: 44%;height:35px;line-height:35px;max-width: 120px;margin: 0 3%;display: inline-block;
- padding: 0;text-align: center;font-size: 14px;
- }
- }
- </style>
|