www.gusucode.com > Flarum开源的PHP国外手机版论坛 0.1 Beta2 源码程序 > Flarum_v0.1.beta2/flarum/vendor/flarum/core/js/lib/helpers/username.js

    /**
 * The `username` helper displays a user's username in a <span class="username">
 * tag. If the user doesn't exist, the username will be displayed as [deleted].
 *
 * @param {User} user
 * @return {Object}
 */
export default function username(user) {
  const name = (user && user.username()) || app.trans('deleted');

  return <span className="username">{name}</span>;
}