Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
thirdlucky
uml-demo
提交
ab8fde2b
U
uml-demo
项目概览
thirdlucky
/
uml-demo
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uml-demo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ab8fde2b
编写于
12月 10, 2021
作者:
S
shenjizhe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1
上级
77dbb582
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
239 addition
and
9 deletion
+239
-9
pages.json
pages.json
+0
-9
uni_modules/thirdlucky-console-view/changelog.md
uni_modules/thirdlucky-console-view/changelog.md
+4
-0
uni_modules/thirdlucky-console-view/components/thirdlucky-console-view/thirdlucky-console-view.vue
...nents/thirdlucky-console-view/thirdlucky-console-view.vue
+92
-0
uni_modules/thirdlucky-console-view/package.json
uni_modules/thirdlucky-console-view/package.json
+80
-0
uni_modules/thirdlucky-console-view/readme.md
uni_modules/thirdlucky-console-view/readme.md
+63
-0
未找到文件。
pages.json
浏览文件 @
ab8fde2b
...
...
@@ -27,15 +27,6 @@
}
}
,{
"path"
:
"pages/test/test-er/console-view/console-view"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
}
],
"globalStyle"
:
{
"navigationBarTextStyle"
:
"black"
,
...
...
uni_modules/thirdlucky-console-view/changelog.md
0 → 100644
浏览文件 @
ab8fde2b
## 1.0.1(2021-12-10)
组件方法的说明文档
## 1.0.0(2021-12-10)
控制台
uni_modules/thirdlucky-console-view/components/thirdlucky-console-view/thirdlucky-console-view.vue
0 → 100644
浏览文件 @
ab8fde2b
<
template
>
<scroll-view
:scroll-y=
"true"
:scroll-top=
"positionY"
>
<textarea
class=
"text-area"
auto-height
v-model=
"text"
@
linechange=
"onLineChange"
:disabled=
"disabled"
></textarea>
</scroll-view>
</
template
>
<
script
>
export
default
{
emits
:
[
'
changed
'
],
props
:
{
name
:
'
uConsoleView
'
,
disabled
:
{
type
:
Boolean
,
required
:
false
,
default
()
{
return
false
;
}
},
needTime
:
{
type
:
Boolean
,
required
:
false
,
default
()
{
return
false
;
}
}
},
data
()
{
return
{
positionY
:
0
,
text
:
''
};
},
computed
:
{
_text
:
{
get
()
{
return
this
.
texts
;
},
set
(
val
)
{
this
.
texts
=
val
;
}
}
},
methods
:
{
onLoad
()
{
this
.
texts
=
this
.
text
;
},
appendText
(
text
)
{
let
line
=
'
'
;
if
(
this
.
needTime
)
{
let
time
=
this
.
dateformat
(
'
yyyy-MM-dd hh:mm:ss.SSS
'
,
new
Date
());
line
+=
time
;
}
line
+=
'
\t
:
'
+
text
+
'
\n
'
;
this
.
text
+=
line
;
this
.
$emit
(
'
changed
'
,
{
action
:
'
append
'
,
text
:
this
.
text
,
append
:
text
});
},
clearText
()
{
this
.
text
=
''
;
this
.
$emit
(
'
changed
'
,
{
action
:
'
clear
'
,
text
:
this
.
text
});
},
onLineChange
(
e
)
{
this
.
positionY
=
e
.
detail
.
height
;
},
dateformat
(
fmt
,
date
)
{
var
o
=
{
'
M+
'
:
date
.
getMonth
()
+
1
,
//月份
'
d+
'
:
date
.
getDate
(),
//日
'
h+
'
:
date
.
getHours
(),
//小时
'
m+
'
:
date
.
getMinutes
(),
//分
'
s+
'
:
date
.
getSeconds
(),
//秒
'
q+
'
:
Math
.
floor
((
date
.
getMonth
()
+
3
)
/
3
),
//季度
'
S+
'
:
date
.
getMilliseconds
()
//毫秒
};
if
(
/
(
y+
)
/
.
test
(
fmt
))
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
(
date
.
getFullYear
()
+
''
).
substr
(
4
-
RegExp
.
$1
.
length
));
for
(
var
k
in
o
)
{
if
(
new
RegExp
(
'
(
'
+
k
+
'
)
'
).
test
(
fmt
))
{
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
RegExp
.
$1
.
length
==
1
?
o
[
k
]
:
((
k
==
'
S+
'
?
'
000
'
:
'
00
'
)
+
o
[
k
]).
substr
((
''
+
o
[
k
]).
length
));
}
}
return
fmt
;
}
}
};
</
script
>
<
style
>
.text-area
{
width
:
100%
;
}
</
style
>
uni_modules/thirdlucky-console-view/package.json
0 → 100644
浏览文件 @
ab8fde2b
{
"id"
:
"thirdlucky-console-view"
,
"displayName"
:
"thirdlucky-console-view"
,
"version"
:
"1.0.1"
,
"description"
:
"thirdlucky-console-view"
,
"keywords"
:
[
"thirdlucky-console-view"
],
"repository"
:
""
,
"engines"
:
{
"HBuilderX"
:
"^3.1.0"
},
"dcloudext"
:
{
"category"
:
[
"前端组件"
,
"通用组件"
],
"sale"
:
{
"regular"
:
{
"price"
:
"0.00"
},
"sourcecode"
:
{
"price"
:
"0.00"
}
},
"contact"
:
{
"qq"
:
""
},
"declaration"
:
{
"ads"
:
"无"
,
"data"
:
"无"
,
"permissions"
:
"无"
},
"npmurl"
:
""
},
"uni_modules"
:
{
"dependencies"
:
[],
"encrypt"
:
[],
"platforms"
:
{
"cloud"
:
{
"tcb"
:
"y"
,
"aliyun"
:
"y"
},
"client"
:
{
"Vue"
:
{
"vue2"
:
"u"
,
"vue3"
:
"u"
},
"App"
:
{
"app-vue"
:
"u"
,
"app-nvue"
:
"u"
},
"H5-mobile"
:
{
"Safari"
:
"u"
,
"Android Browser"
:
"u"
,
"微信浏览器(Android)"
:
"u"
,
"QQ浏览器(Android)"
:
"u"
},
"H5-pc"
:
{
"Chrome"
:
"u"
,
"IE"
:
"u"
,
"Edge"
:
"u"
,
"Firefox"
:
"u"
,
"Safari"
:
"u"
},
"小程序"
:
{
"微信"
:
"u"
,
"阿里"
:
"u"
,
"百度"
:
"u"
,
"字节跳动"
:
"u"
,
"QQ"
:
"u"
},
"快应用"
:
{
"华为"
:
"u"
,
"联盟"
:
"u"
}
}
}
}
}
\ No newline at end of file
uni_modules/thirdlucky-console-view/readme.md
0 → 100644
浏览文件 @
ab8fde2b
# thirdlucky-console-view
## ConsoleView 输出控制台
> **组件名:thirdlucky-console-view**
> 代码块: `uConsoleView`
> 作用: 可以输出日志的控制台
### 安装方式
本组件符合
[
easycom
](
https://uniapp.dcloud.io/collocation/pages?id=easycom
)
规范,
`HBuilderX 2.5.5`
起,只需将本组件导入项目,在页面
`template`
中即可直接使用,无需在页面中
`import`
和注册
`components`
。
如需通过
`npm`
方式使用
`uni-ui`
组件,另行文档:
[
https://ext.dcloud.net.cn/plugin?id=55
](
https://ext.dcloud.net.cn/plugin?id=55
)
### 基本用法
```
html
<template>
<view>
<thirdlucky-console-view
class=
"console-view"
ref=
"consoleView"
disabled
needTime
@
changed=
"onConsoleChanged"
></thirdlucky-console-view>
</view>
</template>
```
```
javascript
<
script
>
export
default
{
methods
:
{
onConsoleChanged
(
e
){
console
.
log
(
e
.
action
,
e
.
text
);
},
appendText
(
text
)
{
this
.
$refs
.
consoleView
.
appendText
(
text
);
},
}
};
<
/script
>
```
## API
### DataTable Props
| 属性名| 类型 |可选值 | 默认值| 说明 |示例 |
| :-: | :-: |:-: |:-: | :-: |:-: |
|disabled|Boolean|可选|false|是否禁用|true|
|needTime|Boolean|可选|false|是否打印时间|true|
#### Localdata Options
### DataTable Events
| 事件名 | 事件说明 | 返回参数 |
| :-: | :-: | :-: |
| @changed | 文本 | e.action:行为(append-添加,clear-清除),text:所有文本,append:新增的数据 |
### DataTable methods
| 方法名 | 事件说明 | 参数 |
| :-: | :-: | :-: |
| appendText | 输出文本 | text:要添加的文本 |
| clearText | 清空控制台 | |
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录