Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
course_creation
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蔡芬
course_creation
Commits
7d3e4012
提交
7d3e4012
authored
11月 22, 2021
作者:
蔡芬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1
上级
b27b91c1
全部展开
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
132 行增加
和
2 行删除
+132
-2
recursion.vue
src/components/common/recursion.vue
+24
-0
tophead.vue
src/components/scaffold/tophead.vue
+94
-0
demo.json
src/demo.json
+0
-0
create.vue
src/views/Course/create.vue
+14
-2
没有找到文件。
src/components/common/recursion.vue
0 → 100644
浏览文件 @
7d3e4012
<
template
>
<div>
<div
v-for=
"item in children"
:key=
"item.id"
>
<tophead
v-if=
"item.type == 'head'"
:detail=
"item"
></tophead>
<recursion
:children=
"item.children"
></recursion>
</div>
</div>
</
template
>
<
script
>
import
tophead
from
'@/components/scaffold/tophead.vue'
;
export
default
{
name
:
"recursion"
,
props
:
{
children
:
Array
,
},
components
:{
tophead
},
}
</
script
>
<
style
>
</
style
>
\ No newline at end of file
src/components/scaffold/tophead.vue
0 → 100644
浏览文件 @
7d3e4012
<
template
>
<div>
<el-input
type=
"text"
placeholder=
"请输入内容"
></el-input>
<div
class=
"edit-title"
>
<div
contenteditable=
"true"
class=
"edit-title-inner"
:id=
"detail.id"
:style=
"detail.style"
>
{{
detail
.
displayTitle
}}
<div
class=
"edit-title-tools displaynone"
contenteditable=
"false"
>
<span
@
click=
"tap('bold')"
>
B
</span>
<span
@
click=
"tap('italic')"
>
I
</span>
<span
@
click=
"tap('underline')"
>
U
</span>
<span
@
click=
"tap('colorpicker')"
>
C
</span>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
export
default
{
props
:{
detail
:
{
type
:
Object
,
default
:
function
()
{
return
{
style
:
{
color
:
'#000'
,
'font-weight'
:
'normal'
,
'text-decoration'
:
'none'
,
'font-style'
:
'normal'
,
}
}
}
}
},
methods
:
{
tap
(
type
)
{
console
.
log
(
'tap'
,
type
)
switch
(
type
)
{
case
"bold"
:
this
.
toggleStyle
(
'font-weight'
,
'bold'
,
'normal'
);
break
;
case
"italic"
:
this
.
toggleStyle
(
'font-style'
,
'italic'
,
'normal'
);
break
;
case
"underline"
:
this
.
toggleStyle
(
'text-decoration'
,
'underline'
,
'none'
);
break
;
case
"colorpicker"
:
// this.toggleStyle('colorpicker','underline','none');
break
;
}
console
.
log
(
this
.
detail
)
},
toggleStyle
(
styleName
,
selVal
,
defVal
)
{
this
.
detail
.
style
[
styleName
]
=
this
.
detail
.
style
[
styleName
]
!=
selVal
?
selVal
:
defVal
;
}
},
}
</
script
>
<
style
lang=
"less"
scoped
>
.edit-title {
position: relative;
margin-top: 5px;
}
.edit-title-inner {
position: relative;
box-sizing: border-box;
height: 100%;
padding: 10px;
height: auto;
&:active,&:focus-visible{
outline: rosybrown auto 1px;
}
&:active > .edit-title-tools,
&:focus-visible > .edit-title-tools{
display: block;
}
}
.edit-title-tools {
position: absolute;
bottom: -100%;
color:#000;
font-weight: normal;
font-style: normal;
text-decoration: none;
cursor: pointer;
>span {
padding: 5px;
background-color: #eee;
}
}
</
style
>
\ No newline at end of file
src/demo.json
0 → 100644
浏览文件 @
7d3e4012
差异被折叠。
点击展开。
src/views/Course/create.vue
浏览文件 @
7d3e4012
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
</el-col>
</el-col>
<el-col
:xs=
"18"
:sm=
"18"
:md=
"18"
:lg=
"18"
:xl=
"18"
>
<el-col
:xs=
"18"
:sm=
"18"
:md=
"18"
:lg=
"18"
:xl=
"18"
>
<div
class=
"course-edit-inner padding_15 height_100p"
>
<div
class=
"course-edit-inner padding_15 height_100p"
>
<recursion
:children=
"trees"
></recursion>
</div>
</div>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -58,8 +58,12 @@
...
@@ -58,8 +58,12 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
recursion
from
'@/components/common/recursion.vue'
;
let
id
=
1000
;
let
id
=
1000
;
export
default
{
export
default
{
components
:{
recursion
},
data
()
{
data
()
{
return
{
return
{
activeName
:
'first'
,
activeName
:
'first'
,
...
@@ -68,6 +72,14 @@ export default {
...
@@ -68,6 +72,14 @@ export default {
id
:
1
,
id
:
1
,
label
:
'首页'
,
label
:
'首页'
,
isFolder
:
'folder'
,
isFolder
:
'folder'
,
type
:
'head'
,
displayTitle
:
'内容标题2'
,
style
:{
'color'
:
'#000'
,
'font-weight'
:
'normal'
,
'text-decoration'
:
'none'
,
'font-style'
:
'normal'
},
children
:
[{
children
:
[{
id
:
4
,
id
:
4
,
label
:
'页面标题'
,
label
:
'页面标题'
,
...
@@ -82,7 +94,7 @@ export default {
...
@@ -82,7 +94,7 @@ export default {
isFolder
:
'file'
isFolder
:
'file'
}]
}]
},{
},{
id
:
4
,
id
:
5
,
label
:
'内容页1'
,
label
:
'内容页1'
,
isFolder
:
'file'
isFolder
:
'file'
}]
}]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论