Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a8d78507
authored
Jan 30, 2023
by
姜鹏凯
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
欢迎语支持换行
1 parent
2b230186
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
37 deletions
linkwe-pc/src/components/TextareaExtend.vue
linkwe-pc/src/components/previewInMobileClient.vue
linkwe-pc/src/components/TextareaExtend.vue
View file @
a8d7850
// 带 插入 表情/客户昵称 等扩展工具栏的文本内容框
// 带 插入 表情/客户昵称 等扩展工具栏的文本内容框
<
script
>
<
script
>
export
default
{
export
default
{
name
:
''
,
name
:
''
,
props
:
{
props
:
{
value
:
''
,
value
:
''
,
// ['emoji','insertCustomerNickName']
// ['emoji','insertCustomerNickName']
toolbar
:
{
toolbar
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[
'emoji'
],
default
:
()
=>
[
'emoji'
]
}
},
},
},
components
:
{
components
:
{
SelectEmoji
:
()
=>
import
(
'@/components/SelectEmoji'
)
SelectEmoji
:
()
=>
import
(
'@/components/SelectEmoji'
),
},
data
()
{
return
{}
},
computed
:
{
proxyValue
:
{
get
()
{
return
this
.
value
},
set
(
val
)
{
this
.
$emit
(
'input'
,
val
)
},
},
},
},
data
()
{
watch
:
{},
return
{}
created
()
{},
mounted
()
{},
methods
:
{
// 插入内容
insertContent
(
value
)
{
const
$textarea
=
this
.
$refs
.
textarea
.
$el
.
children
[
0
]
const
content
=
this
.
proxyValue
||
''
const
textIndex
=
$textarea
.
selectionStart
this
.
proxyValue
=
content
.
slice
(
0
,
textIndex
)
+
value
+
content
.
slice
(
textIndex
)
},
},
},
computed
:
{
}
proxyValue
:
{
get
()
{
return
this
.
value
},
set
(
val
)
{
this
.
$emit
(
'input'
,
val
)
}
}
},
watch
:
{},
created
()
{},
mounted
()
{},
methods
:
{
// 插入内容
insertContent
(
value
)
{
const
$textarea
=
this
.
$refs
.
textarea
.
$el
.
children
[
0
]
const
content
=
this
.
proxyValue
||
''
const
textIndex
=
$textarea
.
selectionStart
this
.
proxyValue
=
content
.
slice
(
0
,
textIndex
)
+
value
+
content
.
slice
(
textIndex
)
}
}
}
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -55,4 +55,8 @@ export default {
...
@@ -55,4 +55,8 @@ export default {
</div>
</div>
</
template
>
</
template
>
<
style
lang=
"scss"
scoped
></
style
>
<
style
lang=
"scss"
scoped
>
textarea
{
white-space
:
pre-wrap
;
//保留所有空格
}
</
style
>
linkwe-pc/src/components/previewInMobileClient.vue
View file @
a8d7850
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment