mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Improve code-editor.js
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
@@ -18,20 +18,15 @@ export default function codeEditorFormComponent({
|
||||
state,
|
||||
|
||||
getLanguageExtension() {
|
||||
switch (language) {
|
||||
case 'css':
|
||||
return css()
|
||||
case 'html':
|
||||
return html()
|
||||
case 'javascript':
|
||||
return javascript()
|
||||
case 'json':
|
||||
return json()
|
||||
case 'php':
|
||||
return php()
|
||||
default:
|
||||
return []
|
||||
const extensions = {
|
||||
css: css,
|
||||
html: html,
|
||||
javascript: javascript,
|
||||
json: json,
|
||||
php: php,
|
||||
}
|
||||
|
||||
return extensions[language]?.() || []
|
||||
},
|
||||
|
||||
init: function () {
|
||||
|
||||
Reference in New Issue
Block a user