Skip to main content

activeUser

activeUser

activeUser: number

this property identifies the current user. It controls the ability to edit or delete comments made by this user and applies specific styling to those comments. The default value is null.

Usage

Defining current user

<script>
import { Comments } from 'wx-svelte-comments';

const users = [
{ id: 1, name: "John Doe" },
{ id: 2, name: "Jane Doe" },
];
</script>

<Comments {value} {users} activeUser={1} />

In this example, the active user is set to the user with ID 1. Comments made by this user can be edited or deleted through the UI and will have separate styling.