Insert the `at` or not
PS. All blocks in this article like this word
would be an option in settings
Somebody want to insert the at
into inputor(textarea/contentEditable), but somebody don't.
So, maybe I can just add an optional setting, But i think there is a better way: using the tpl
.
First, After v0.4.0, At.js will not insert the at
anymore. But the default tpl
will do it instead!
So, If you have to customize tpl
or inserted_tpl
and want to insert the at
as well, You have to do it yourself.
Textarea
Now At.js will just insert the data-value in tpl
, so you can just put the at
into it or remove it:
// for {at: "@"} and don't insert it. <li data-value='${name}'>${name}</li> // for emojis {at: ":"} and insert it. <li data-value=':${name}:'>${name}</li>
In default tpl
: <li data-value='${atwho-at}${name}'>${name}</li>
, The variable: atwho-at would just be the current at
. you can use it if you like. ;)
ContentEditable Mode
In contentEditable mode, At.js will just insert data-value in tpl
by default too.
so if you want to customize inserted_tpl
, choose to insert the at
or not by yourself. For example:
// Default inserted_tpl: <span>${atwho-data-value}</span> // Customize and Don't insert `at`: <div>${name}<span class="large">${title}</span></div> // Customize and insert `at`: <div><span class="at-class">@</span><span class="user-name">${name}</span></div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论