Skip to content
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

how to get selected members? #34

Open
ghost opened this issue Jan 12, 2018 · 10 comments
Open

how to get selected members? #34

ghost opened this issue Jan 12, 2018 · 10 comments

Comments

@ghost
Copy link

ghost commented Jan 12, 2018

Need to get selected members on array

@fritx
Copy link
Owner

fritx commented Jan 13, 2018

See discussion we had before.. #8 (comment)

What api do you prefer, or any suggestions?

@fritx
Copy link
Owner

fritx commented Jan 17, 2018

@abzalzhumabaev you want the list of all the @xx patterns in the content or the only ones selected from at-panel, or both of them?

  • .getAtList()
  • .getSelectedList()

@rap2hpoutre
Copy link

@fritx Both of them I think : get all the referenced members (it does not matter if they are referenced via one way or another)

@Spatlani
Copy link

Any update on this?

@fritx
Copy link
Owner

fritx commented May 16, 2018

Not yet supported, it would base on a regex match though.
For now you could probably use your own to match all the @d members.

@SamHz
Copy link

SamHz commented Jun 7, 2018

textarea中我也需要获取选中的成员,但现在我测试在@changegetlistgetSelectedList都是没有用的,最终我如果想知道选中的人只能通过正则吗?这样很不友好,望能添加此功能,并且希望能加上一个类似At.js的功能,能动态获得用户,因为在一般场景下,当用户超过一定数量,数据显示将变得很难处理,希望能得到这个功能,谢谢
$('#inputor').atwho({ at: "@", callbacks: { matcher: function(flag, subtext) { var match, matched, regexp; regexp = new XRegExp('(\\s+|^)' + flag + '(\\p{L}+)$', 'gi'); match = regexp.exec(subtext); // ... get matched result return matched; } //, ... others callbacks } });

@fritx
Copy link
Owner

fritx commented Jun 9, 2018

@SamHz 好的,但其实这个从content中匹配@了那些人,也可以理解为是一个多处都会公用到的逻辑,不算在这个库的范畴(比如后台也会用到)。

所以可以考虑一下自己实现,(我们这边的产品就是这样,另外自己匹配出来)。

这段逻辑库如果能包办也不错,如果不包办,走文档中能体现确实也很必要。

动态获取展示,可以参考一下这个做法 #16 (comment) ,但不确定能否暂时解决你的问题

@adammoroff
Copy link

Hi there, is this feature supported yet? Thanks.

@cindy-123
Copy link

可以在插入内容的时候处理已选的人员id,在方法insertItem中处理 if (
mentionUserIds &&
JSON.stringify(mentionUserIds).indexOf(curItem.id) == -1
) {
mentionUserIds.push(curItem.id);
}
然后通过this.$refs.mentionUserIds获取到,中间有一些陈述省去了,主要就是在插入名字的时候处理被选的人员列表

@jggj21
Copy link

jggj21 commented Aug 3, 2021

I am using <at-ta/> with textarea and in my case I can't get getAtList();

<at-ta
:hoverSelect="true"
:members="members"
v-model="usersMentioned"
name-key="name"
@at="handleAt"
@insert="handleInsert"
@change="handleAtChange"
ref="atTa"
:avoidEmail="false"
>                                     
    <template slot="item" slot-scope="s">
      <span v-text="s.item.name"></span>
   </template>
   <el-input
   type="textarea"
  placeholder="Add to Conversation"
  v-model="replyData.message"
  ></el-input>
</at-ta>

 handleAtChange(data) {
      this.usersMentioned = data;
  },
 reply(){
  console.log(this.$refs.atTa.getAtList);// The method does not exist
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants