代码片段 https://angular.carbondesignsystem.com/?path=/story/components-code-snippet—basic
组件及属性
- code-snippet
- Input
- theme: light/dark = dark
- feedbackText
- feedbackTimeout
- Output
- none
- HostBinding
- class.bx—snippet—expand
@Input
expanded = false - class.bx—skeleton
@Input
skeleton = false - class.bx—snippet snippetClass = true
- class.bx—snippet—single, display === SnippetType.single
- class.bx—snippet—multi, display === SnippetType.multi
- class.bx—snippet—light
- class.bx—btn—copy, display === SnippetType.inline
- style.display
- attr.type
Tips
这个标签之前没有注意到,竟然原生有这个标签。用来展示代码。tag
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/codeCode
https://github.com/llccing-demo/carbon-components-angular/blob/master/src/code-snippet/code-snippet.component.ts感谢
朋友你好,如果你对我的文章感兴趣,欢迎关注我的 Github (https://github.com/llccing),或者掘金 (https://juejin.cn/user/3227821867281079),或者语雀 (https://www.yuque.com/uov16w),感谢你的支持!
- class.bx—snippet—expand
- Input