manaco editor 如何显示颜色装饰器?

const editor = monaco.editor.create(containerRef.current, {
          value: 'body {\n\tcolor:red\n}',
          language: language,
          theme: "vs-dark",
          colorDecorators: true
        });

当 language 是 css 时发现颜色装饰器无法显示颜色装饰。colorDecorators 在 vscode 也有一样的配置,因为 vscode 是基于 manaco editor,具体是 red 前会显示一个红色块,而且允许修改颜色值。但是发现这个配置在 manaco editor 中可以设置,但是设置后没有效果,这是什么原因?

阅读 3.1k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题