File tree Expand file tree Collapse file tree 6 files changed +136
-9
lines changed Expand file tree Collapse file tree 6 files changed +136
-9
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ An out-of-box UI solution for enterprise applications as a Vue boilerplate. base
7
7
8
8
<div align =" center " >
9
9
10
- [ ![ License] ( https://img.shields.io/npm/l/package.json.svg?style=flat )] ( https://github.com/sendya /ant-design-pro- vue/blob/master/LICENSE )
11
- [ ![ Release] ( https://img.shields.io/github/release/vueComponent/ant-design-vue-pro.svg?style=flat )] ( https://github.com/sendya /ant-design-pro- vue/releases/latest )
12
- [ ![ Travis branch] ( https://travis-ci.org/vueComponent/ant-design-vue-pro.svg?branch=master )] ( https://travis-ci.org/sendya /ant-design-pro- vue )
10
+ [ ![ License] ( https://img.shields.io/npm/l/package.json.svg?style=flat )] ( https://github.com/vueComponent /ant-design-vue-pro /blob/master/LICENSE )
11
+ [ ![ Release] ( https://img.shields.io/github/release/vueComponent/ant-design-vue-pro.svg?style=flat )] ( https://github.com/vueComponent /ant-design-vue-pro /releases/latest )
12
+ [ ![ Travis branch] ( https://travis-ci.org/vueComponent/ant-design-vue-pro.svg?branch=master )] ( https://travis-ci.org/vueComponent /ant-design-vue-pro )
13
13
14
14
</div >
15
15
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ An out-of-box UI solution for enterprise applications as a Vue boilerplate. base
9
9
10
10
[ ![ License] ( https://img.shields.io/npm/l/package.json.svg?style=flat )] ( https://github.com/vueComponent/ant-design-vue-pro/blob/master/LICENSE )
11
11
[ ![ Release] ( https://img.shields.io/github/release/vueComponent/ant-design-vue-pro.svg?style=flat )] ( https://github.com/vueComponent/ant-design-vue-pro/releases/latest )
12
- [ ![ Travis branch] ( https://travis-ci.org/vueComponent/ant-design-vue-pro.svg?branch=master )] ( https://travis-ci.org/sendya /ant-design-pro- vue )
12
+ [ ![ Travis branch] ( https://travis-ci.org/vueComponent/ant-design-vue-pro.svg?branch=master )] ( https://travis-ci.org/vueComponent /ant-design-vue-pro )
13
13
14
14
</div >
15
15
Original file line number Diff line number Diff line change
1
+ <script >
2
+ const carbonUrl = ' //cdn.carbonads.com/carbon.js?serve=CK7DL2JW&placement=antdvcom'
3
+ export default {
4
+ props: {
5
+ isMobile: Boolean
6
+ },
7
+ watch: {
8
+ $route (e, t) {
9
+ const adId = ' #carbonads'
10
+ // if(isGitee) {
11
+ // adId = '#cf';
12
+ // }
13
+ if (e .path !== t .path && this .$el .querySelector (adId)) {
14
+ this .$el .innerHTML = ' '
15
+ this .load ()
16
+ }
17
+ this .adInterval && clearInterval (this .adInterval )
18
+ this .adInterval = setInterval (() => {
19
+ if (! this .$el .querySelector (adId)) {
20
+ this .$el .innerHTML = ' '
21
+ this .load ()
22
+ }
23
+ }, 20000 )
24
+ }
25
+ },
26
+ mounted () {
27
+ this .load ()
28
+ },
29
+ methods: {
30
+ load () {
31
+ // if(isGitee) {
32
+ // axios.get('https://api.codefund.app/properties/162/funder.html?template=horizontal')
33
+ // .then(function (response) {
34
+ // document.getElementById("codefund-ads").innerHTML = response.data;
35
+ // });
36
+ // } else
37
+ if (carbonUrl) {
38
+ const e = document .createElement (' script' )
39
+ e .id = ' _carbonads_js'
40
+ e .src = carbonUrl
41
+ this .$el .appendChild (e)
42
+ }
43
+ }
44
+ },
45
+ render () {
46
+ return < div id= " carbon-ads" class = {this .isMobile ? ' carbon-mobile' : ' ' } / >
47
+ }
48
+ }
49
+ </script >
50
+ <style lang="less">
51
+ #carbon-ads {
52
+ width : 256px ;
53
+ /* float: right; */
54
+ margin-top : 75px ;
55
+ position : fixed ;
56
+ left : 0 ;
57
+ bottom : 0 ;
58
+ padding : 0 ;
59
+ overflow : hidden ;
60
+ z-index : 100 ;
61
+ background-color : #fff ;
62
+ /* border-radius: 3px; */
63
+ font-size : 13px ;
64
+ background : #f5f5f5 ;
65
+ font-family : ' Source Sans Pro' , ' Helvetica Neue' , Arial , sans-serif ;
66
+ }
67
+ #carbonads {
68
+ overflow : hidden ;
69
+ }
70
+ #carbon-ads a {
71
+ display : inline-block ;
72
+ color : #7f8c8d ;
73
+ font-weight : normal ;
74
+ }
75
+ #carbon-ads span {
76
+ color : #7f8c8d ;
77
+ }
78
+ #carbon-ads img {
79
+ float : left ;
80
+ padding-right : 10px ;
81
+ }
82
+ #carbon-ads .carbon-img ,
83
+ #carbon-ads .carbon-text {
84
+ display : block ;
85
+ font-weight : normal ;
86
+ color : #34495e ;
87
+ }
88
+ #carbon-ads .carbon-text {
89
+ padding-top : 6px ;
90
+ display : -webkit-box ;
91
+ -webkit-box-orient : vertical ;
92
+ -webkit-line-clamp : 4 ;
93
+ overflow : hidden ;
94
+ }
95
+ #carbon-ads .carbon-poweredby {
96
+ color : #aaa ;
97
+ font-weight : normal ;
98
+ line-height : 1.2 ;
99
+ margin-top : 6px ;
100
+ }
101
+ #carbon-ads .carbon-mobile {
102
+ width : 100% ;
103
+ position : relative ;
104
+ right : 0 ;
105
+ bottom : 0 ;
106
+ padding : 0 ;
107
+ margin-bottom : 15px ;
108
+ margin-top : 5px ;
109
+ .carbon-img {
110
+ float : left ;
111
+ margin-right : 10px ;
112
+ }
113
+ }
114
+ </style >
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import store from '@/store'
12
12
* - 当前用户没有权限时,组件上使用了该指令则会被隐藏
13
13
* - 当后台权限跟 pro 提供的模式不同时,只需要针对这里的权限过滤进行修改即可
14
14
*
15
- * @see https://github.com/sendya /ant-design-pro- vue/pull/53
15
+ * @see https://github.com/vueComponent /ant-design-vue-pro /pull/53
16
16
*/
17
17
const action = Vue . directive ( 'action' , {
18
18
inserted : function ( el , binding , vnode ) {
Original file line number Diff line number Diff line change 11
11
:i18nRender =" i18nRender"
12
12
v-bind =" settings"
13
13
>
14
+ <!-- Ads begin
15
+ 广告代码 真实项目中请移除
16
+ production remove this Ads
17
+ -->
18
+ <ads v-if =" isProPreviewSite" />
19
+ <!-- Ads end -->
20
+
14
21
<setting-drawer :settings =" settings" @change =" handleSettingChange" />
15
22
<template v-slot :rightContentRender >
16
23
<right-content :top-menu =" settings.layout === 'topmenu'" :is-mobile =" isMobile" :theme =" settings.theme" />
@@ -31,17 +38,23 @@ import { SIDEBAR_TYPE, TOGGLE_MOBILE_TYPE } from '@/store/mutation-types'
31
38
import defaultSettings from ' @/config/defaultSettings'
32
39
import RightContent from ' @/components/GlobalHeader/RightContent'
33
40
import GlobalFooter from ' @/components/GlobalFooter'
41
+ import Ads from ' @/components/Other/CarbonAds'
34
42
import LogoSvg from ' ../assets/logo.svg?inline'
35
43
36
44
export default {
37
45
name: ' BasicLayout' ,
38
46
components: {
39
47
SettingDrawer,
40
48
RightContent,
41
- GlobalFooter
49
+ GlobalFooter,
50
+ Ads
42
51
},
43
52
data () {
44
53
return {
54
+ // preview.pro.antdv.com only use.
55
+ isProPreviewSite: process .env .VUE_APP_PREVIEW === ' true' ,
56
+ // end
57
+
45
58
// base
46
59
menus: [],
47
60
// 侧栏收起状态
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ const routerObject = {
42
42
| keepAlive | 缓存该路由 | boolean | false |
43
43
| target | 菜单链接跳转目标(参考 html a 标记) | string | - |
44
44
| hidden | 配合` hideChildrenInMenu ` 使用,用于隐藏菜单时,提供递归到父菜单显示 选中菜单项_ (可参考 个人页 配置方式)_ | boolean | false |
45
- | hiddenHeaderContent | * 特殊 隐藏 [ PageHeader] ( https://github.com/sendya /ant-design-pro- vue/blob/master/src/components/PageHeader/PageHeader.vue#L6 ) 组件中的页面带的 面包屑和页面标题栏 | boolean | false |
45
+ | hiddenHeaderContent | * 特殊 隐藏 [ PageHeader] ( https://github.com/vueComponent /ant-design-vue-pro /blob/master/src/components/PageHeader/PageHeader.vue#L6 ) 组件中的页面带的 面包屑和页面标题栏 | boolean | false |
46
46
| permission | 与项目提供的权限拦截匹配的权限,如果不匹配,则会被禁止访问该路由页面 | array | [ ] |
47
47
48
48
> 路由自定义 ` Icon ` 请引入自定义 ` svg ` Icon 文件,然后传递给路由的 ` meta.icon ` 参数即可
@@ -123,12 +123,12 @@ const asyncRouterMap = [
123
123
> 1 . 请注意 ` component: () => import('..') ` 方式引入路由的页面组件为 懒加载模式。具体可以看 [ Vue 官方文档] ( https://router.vuejs.org/zh/guide/advanced/lazy-loading.html )
124
124
> 2 . 增加新的路由应该增加在 '/' (index) 路由的 ` children ` 内
125
125
> 3 . 子路由的父级路由必须有 ` router-view ` 才能让子路由渲染出来,请仔细查阅 vue-router 文档
126
- > 4 . ` permission ` 可以进行自定义修改,只需要对这个模块进行自定义修改即可 [ src/store/modules/permission.js#L10] ( https://github.com/sendya /ant-design-pro- vue/blob/master/src/store/modules/permission.js#L10 )
126
+ > 4 . ` permission ` 可以进行自定义修改,只需要对这个模块进行自定义修改即可 [ src/store/modules/permission.js#L10] ( https://github.com/vueComponent /ant-design-vue-pro /blob/master/src/store/modules/permission.js#L10 )
127
127
128
128
129
129
附权限路由结构:
130
130
131
131
![ 权限结构] ( https://static-2.loacg.com/open/static/github/permissions.png )
132
132
133
133
134
- 第二种前端路由由后端动态生成的设计,可以前往官网文档 https://pro.loacg .com/docs/authority-management 参考
134
+ 第二种前端路由由后端动态生成的设计,可以前往官网文档 https://pro.antdv .com/docs/authority-management 参考
You can’t perform that action at this time.
0 commit comments