feat: 修改 @ 样式

This commit is contained in:
Tim
2025-07-31 19:53:21 +08:00
parent c541306494
commit 4fcc47aa40
4 changed files with 23 additions and 17 deletions

View File

@@ -12,7 +12,7 @@
"echarts": "^5.6.0",
"ldrs": "^1.1.7",
"markdown-it": "^14.1.0",
"vditor": "^3.8.7",
"vditor": "^3.11.1",
"vue": "^3.2.13",
"vue-easy-lightbox": "^1.19.0",
"vue-echarts": "^7.0.3",
@@ -11330,9 +11330,9 @@
}
},
"node_modules/vditor": {
"version": "3.8.7",
"resolved": "https://registry.npmjs.org/vditor/-/vditor-3.8.7.tgz",
"integrity": "sha512-7loYmcj1TCkJV86qwstxzAy33GweFKdJnpiSzGGPqUzDaOcUAiaiFAjIQjxwJ3/sx7pNZf1NWLhXKabXEN7xzQ==",
"version": "3.11.1",
"resolved": "https://registry.npmjs.org/vditor/-/vditor-3.11.1.tgz",
"integrity": "sha512-7rjNSXYVyZG0mVZpUG2tfxwnoNtkcRCnwdSju+Zvpjf/r72iQa6kLpeThFMIKPuQ5CRnQQv6gnR3eNU6UGbC2Q==",
"license": "MIT",
"dependencies": {
"diff-match-patch": "^1.0.5"

View File

@@ -9,15 +9,15 @@
},
"dependencies": {
"core-js": "^3.8.3",
"echarts": "^5.6.0",
"ldrs": "^1.1.7",
"markdown-it": "^14.1.0",
"vditor": "^3.8.7",
"vditor": "^3.11.1",
"vue": "^3.2.13",
"vue-router": "^4.5.1",
"vue-toastification": "^2.0.0-rc.5",
"vue-easy-lightbox": "^1.19.0",
"echarts": "^5.6.0",
"vue-echarts": "^7.0.3"
"vue-echarts": "^7.0.3",
"vue-router": "^4.5.1",
"vue-toastification": "^2.0.0-rc.5"
},
"devDependencies": {
"@babel/core": "^7.12.16",

View File

@@ -43,14 +43,18 @@ export function createVditor(editorId, options = {}) {
theme: getEditorTheme(),
preview: Object.assign({ theme: { current: getPreviewTheme() } }, preview),
hint: {
delay: 200,
at: async (value) => {
const list = await fetchMentions(value)
return list.map(u => ({
value: u.username,
html: `<span>@${u.username}</span>`
}))
}
extend: [
{
key: '@',
hint: async (key) => {
const list = await fetchMentions(key)
return list.map(u => ({
value: `@[${u.username}]`,
html: `<img src="${u.avatar}" /> @${u.username}`
}))
},
},
],
},
cdn: 'https://openisle-1307107697.cos.ap-guangzhou.myqcloud.com/assert/vditor',
toolbar: [

View File

@@ -68,6 +68,7 @@ public class SearchController {
UserDto dto = new UserDto();
dto.setId(user.getId());
dto.setUsername(user.getUsername());
dto.setAvatar(user.getAvatar());
return dto;
}
@@ -82,6 +83,7 @@ public class SearchController {
private static class UserDto {
private Long id;
private String username;
private String avatar;
}
@Data