From 0ff109ba295ba3c7b35fe8592a6b7d5baca4105b Mon Sep 17 00:00:00 2001 From: sight <26325820+Sight-wcg@users.noreply.github.com> Date: Sat, 19 Jul 2025 19:42:10 +0800 Subject: [PATCH] =?UTF-8?q?docs(code):=20=E6=9B=B4=E6=96=B0=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/code/detail/options.md | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/docs/code/detail/options.md b/docs/code/detail/options.md index a572fbd9..5b8d388c 100644 --- a/docs/code/detail/options.md +++ b/docs/code/detail/options.md @@ -393,6 +393,44 @@ onCopy: function(code, copied){ ``` + + + + + +[highlightLine](#options.highlightLine) 2.12+ + + + + +
+设置行高亮,可选值: +- hl:高亮 +- ++:diff++ +- --:diff-- +- focus:聚焦 +
+ +通过 `range` 选项或注释 `[!code type:]` 指定行高亮范围 + +``` +highlightLine: { + hl: { + range: '1,3-5,8', // 指定行高亮范围 '1,3,4,5,8' + comment: true, // 是否解析行中的高亮注释 + } +} +``` + +``` +layui.use(function(){ // [!code focus:5] + var layer = layui.layer; // [!code hl] + + layer.msg('test'); +}) + +``` +