-
Notifications
You must be signed in to change notification settings - Fork 116
Add hook to selection #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
e9a8d79
f6c08d2
f2e9503
4ecbe97
a9a4e40
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,12 @@ export default { | |
scrollRef: { | ||
type: String, | ||
default: '' | ||
} | ||
}, | ||
processItem: { | ||
type: Function, | ||
default: (list, cur, suffix) => { | ||
return itemName(list[cur]) + suffix | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm afriad the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It shouldn’t be undefind. I was able to use it. Maybe add a check first? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mankowitz it should be |
||
} | ||
}, | ||
|
||
data () { | ||
|
@@ -352,7 +357,7 @@ export default { | |
// hack: 连续两次 可以确保click后 focus回来 range真正生效 | ||
applyRange(r) | ||
applyRange(r) | ||
const t = itemName(list[cur]) + suffix | ||
const t = processItem(list, cur, suffix) | ||
this.insertText(t, r) | ||
this.handleInput() | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
:class="isCur(index) && 'atwho-cur'" | ||
:ref="isCur(index) && 'cur'" | ||
:data-index="index" | ||
:key="index" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
@mouseenter="handleItemHover" | ||
@click="handleItemClick" | ||
> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed to use
slot-scope
as a Vue upgrade, 👍but I've been afraid it would break users that were still using older versions of Vue.
So I'd like to make such changes later in a major bump 😄