Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
计算机应用开发
前端
Vuepress
提交
cb875323
V
Vuepress
项目概览
计算机应用开发
/
前端
/
Vuepress
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
Vuepress
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
cb875323
编写于
10月 30, 2018
作者:
U
ULIVZ
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: @vuepress/theme-vue
上级
497ce801
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
220 addition
and
0 deletion
+220
-0
packages/@vuepress/theme-vue/components/BuySellAds.vue
packages/@vuepress/theme-vue/components/BuySellAds.vue
+98
-0
packages/@vuepress/theme-vue/components/CarbonAds.vue
packages/@vuepress/theme-vue/components/CarbonAds.vue
+60
-0
packages/@vuepress/theme-vue/index.js
packages/@vuepress/theme-vue/index.js
+3
-0
packages/@vuepress/theme-vue/layouts/Layout.vue
packages/@vuepress/theme-vue/layouts/Layout.vue
+24
-0
packages/@vuepress/theme-vue/package.json
packages/@vuepress/theme-vue/package.json
+35
-0
未找到文件。
packages/@vuepress/theme-vue/components/BuySellAds.vue
0 → 100644
浏览文件 @
cb875323
<
script
>
/* global _bsa */
const
ID
=
'
bsa-cpc-script
'
export
default
{
render
(
h
)
{
return
h
(
'
div
'
,
{
class
:
'
bsa-cpc-wrapper
'
},
[
h
(
'
div
'
,
{
ref
:
'
ads
'
,
class
:
'
bsa-cpc
'
})
])
},
mounted
()
{
if
(
!
document
.
getElementById
(
ID
))
{
const
s
=
document
.
createElement
(
'
script
'
)
s
.
id
=
ID
s
.
src
=
`//m.servedby-buysellads.com/monetization.js`
document
.
head
.
appendChild
(
s
)
s
.
onload
=
()
=>
{
this
.
load
()
}
}
else
{
this
.
load
()
}
},
watch
:
{
'
$route
'
(
to
,
from
)
{
if
(
to
.
path
!==
from
.
path
)
{
this
.
$refs
.
ads
.
innerHTML
=
''
this
.
load
()
}
}
},
methods
:
{
load
()
{
if
(
typeof
_bsa
!==
'
undefined
'
&&
_bsa
)
{
_bsa
.
init
(
'
default
'
,
'
CKYD62QM
'
,
'
placement:vuejsorg
'
,
{
target
:
'
.bsa-cpc
'
,
align
:
'
horizontal
'
,
disable_css
:
'
true
'
})
}
}
}
}
</
script
>
<
style
lang=
"stylus"
>
.bsa-cpc-wrapper
font-size 0.95rem
max-width $contentWidth
margin 0px auto
padding 1rem 2rem 0
margin-bottom -1rem
@media (max-width: $MQMobileNarrow)
.bsa-cpc-wrapper
padding 0 1.5rem
.bsa-cpc
font-size .9em
background-color #f8f8f8
border-radius 6px
a
&._default_
text-align left
display block
padding 10px 15px 12px
margin-bottom 20px
color #666
font-weight 400
line-height 18px
.default-image
img
height 20px
border-radius 3px
vertical-align middle
position relative
top -1px
.default-title
font-weight 600
.default-description
&:after
font-size 0.85em
content "Sponsored"
color #1C90F3
border 1px solid #1C90F3
border-radius 3px
padding 0 4px 1px
margin-left 6px
.default-ad
display none
.bsa-cpc a._default_ .default-image,
.bsa-cpc a._default_ .default-title,
.bsa-cpc a._default_ .default-description
display inline
vertical-align middle
margin-right 6px
</
style
>
packages/@vuepress/theme-vue/components/CarbonAds.vue
0 → 100644
浏览文件 @
cb875323
<
script
>
export
default
{
render
(
h
)
{
return
h
(
'
div
'
,
{
class
:
'
carbon-ads
'
})
},
mounted
()
{
this
.
load
()
},
watch
:
{
'
$route
'
(
to
,
from
)
{
if
(
to
.
path
!==
from
.
path
&&
// Only reload if the ad has been loaded
// otherwise it's possible that the script is appended but
// the ads are not loaded yet. This would result in duplicated ads.
this
.
$el
.
querySelector
(
'
#carbonads
'
)
)
{
this
.
$el
.
innerHTML
=
''
this
.
load
()
}
}
},
methods
:
{
load
()
{
const
s
=
document
.
createElement
(
'
script
'
)
s
.
id
=
'
_carbonads_js
'
s
.
src
=
`//cdn.carbonads.com/carbon.js?serve=CKYIK2QU&placement=vuejsorg`
this
.
$el
.
appendChild
(
s
)
}
}
}
</
script
>
<
style
lang=
"stylus"
>
.carbon-ads
min-height 102px
padding 1.5rem 1.5rem 0
margin-bottom -0.5rem
font-size 0.75rem
a
color #444
font-weight normal
display inline
.carbon-img
float left
margin-right 1rem
border 1px solid $borderColor
img
display block
.carbon-poweredby
color #999
display block
margin-top 0.5em
@media (max-width: $MQMobile)
.carbon-ads
.carbon-img img
width 100px
height 77px
</
style
>
packages/@vuepress/theme-vue/index.js
0 → 100644
浏览文件 @
cb875323
module
.
exports
=
{
extend
:
'
@vuepress/theme-default
'
}
packages/@vuepress/theme-vue/layouts/Layout.vue
0 → 100644
浏览文件 @
cb875323
<
template
>
<Layout>
<CarbonAds
slot=
"sidebar-top"
/>
<BuySellAds
slot=
"page-bottom"
/>
</Layout>
</
template
>
<
script
>
import
Layout
from
'
@parent-theme/layouts/Layout.vue
'
import
CarbonAds
from
'
../components/CarbonAds.vue
'
import
BuySellAds
from
'
../components/BuySellAds.vue
'
export
default
{
components
:
{
Layout
,
CarbonAds
,
BuySellAds
},
mounted
()
{
console
.
log
(
'
mounted
'
)
}
}
</
script
>
packages/@vuepress/theme-vue/package.json
0 → 100644
浏览文件 @
cb875323
{
"private"
:
true
,
"name"
:
"@vuepress/theme-vue"
,
"version"
:
"1.0.0-alpha.17"
,
"description"
:
"VuePress theme for official Vue projects"
,
"main"
:
"index.js"
,
"publishConfig"
:
{
"access"
:
"public"
},
"repository"
:
{
"type"
:
"git"
,
"url"
:
"git+https://github.com/vuejs/vuepress.git"
},
"keywords"
:
[
"documentation"
,
"vue"
,
"vuepress"
,
"generator"
],
"author"
:
"Evan You"
,
"maintainers"
:
[
{
"name"
:
"ULIVZ"
,
"email"
:
"chl814@foxmail.com"
}
],
"license"
:
"MIT"
,
"bugs"
:
{
"url"
:
"https://github.com/vuejs/vuepress/issues"
},
"homepage"
:
"https://github.com/vuejs/vuepress/packages/@vuepress/theme-vue#readme"
,
"dependencies"
:
{
"@vuepress/theme-default"
:
"^1.0.0-alpha.17"
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录