-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
xuguanjie
committed
Feb 16, 2024
1 parent
1498ada
commit 6910753
Showing
9 changed files
with
106 additions
and
7 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
packages/cw/cw_text_power_library/components/cw-typed-view/api.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
- name: cw-typed-view | ||
title: 打字机文本 | ||
type: both | ||
belong: component | ||
labels: [Runtime] | ||
attrs: | ||
- name: value | ||
title: 文本内容 | ||
type: string | ||
default: 请在这里输入内容 | ||
description: 需要传入的值 | ||
- name: typeSpeed | ||
title: 打字速度 | ||
type: number | ||
default: 40 | ||
description: 打字速度,单位为毫秒 | ||
- name: showCursor | ||
title: 展示光标 | ||
type: boolean | ||
default: false |
5 changes: 5 additions & 0 deletions
5
packages/cw/cw_text_power_library/components/cw-typed-view/docs/blocks.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
### 基本用法 | ||
|
||
``` html | ||
<cw-typed-view></cw-typed-view> | ||
``` |
5 changes: 5 additions & 0 deletions
5
packages/cw/cw_text_power_library/components/cw-typed-view/docs/examples.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
### 基本用法 | ||
|
||
``` html | ||
<cw-typed-view></cw-typed-view> | ||
``` |
3 changes: 3 additions & 0 deletions
3
packages/cw/cw_text_power_library/components/cw-typed-view/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import CwTypedView from "./index.vue" | ||
|
||
export default CwTypedView |
62 changes: 62 additions & 0 deletions
62
packages/cw/cw_text_power_library/components/cw-typed-view/index.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<div style="display:flex"> | ||
<div ref="my-type" v-if="!inIDE" > | ||
</div> | ||
<div v-else> | ||
{{value}} | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Typed from 'typed.js'; | ||
export default { | ||
name:"cw-typed-view", | ||
props:{ | ||
value:{ | ||
type:String, | ||
default:"请在这里输入内容" | ||
}, | ||
showCursor:{ | ||
type:Boolean, | ||
default:false | ||
}, | ||
typeSpeed:{ | ||
type:Number, | ||
default:40 | ||
}, | ||
// backSpeed:{ | ||
// type:Number, | ||
// default:40 | ||
// } | ||
}, | ||
computed:{ | ||
inIDE(){ | ||
return this.$env&& this.$env.VUE_APP_DESIGNER || false | ||
}, | ||
}, | ||
data(){ | ||
return { | ||
typed:null | ||
}}, | ||
mounted(){ | ||
if(!this.inIDE){ | ||
this.typed = new Typed(this.$refs['my-type'], { | ||
strings: [this.value], | ||
typeSpeed: this.typeSpeed, | ||
showCursor:this.showCursor, | ||
// backSpeed: this.backSpeed, | ||
// loop: true | ||
}); | ||
} | ||
}, | ||
destroyed(){ | ||
this.typed && this.typed.destroy(); | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import CwWangEditor from './components/cw-wang-editor'; | ||
import CwTypedView from './components/cw-typed-view'; | ||
// COMPONENT IMPORTS | ||
export { | ||
CwWangEditor, | ||
CwTypedView, | ||
// COMPONENT EXPORTS | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Plugin-Version: 1.0.0 | ||
Library-Type: Frontend | ||
Metadata-File: usage.json | ||
packages/extension/cw_text_power_library@1.0.8/dist-theme/demo.html: dist-theme/demo.html | ||
packages/extension/cw_text_power_library@1.0.8/dist-theme/index.js: dist-theme/index.js | ||
packages/extension/cw_text_power_library@1.0.8/dist-theme/index.js.map: dist-theme/index.js.map | ||
packages/extension/cw_text_power_library@1.1.0/dist-theme/demo.html: dist-theme/demo.html | ||
packages/extension/cw_text_power_library@1.1.0/dist-theme/index.js: dist-theme/index.js | ||
packages/extension/cw_text_power_library@1.1.0/dist-theme/index.js.map: dist-theme/index.js.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters