mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
修改 monaco-editor 静态资源地址
This commit is contained in:
parent
b79d10b452
commit
4e66a3aff5
|
@ -47,4 +47,10 @@ export default defineConfig({
|
|||
'https://gw.alipayobjects.com/os/lib/react/18.2.0/umd/react.production.min.js',
|
||||
'https://gw.alipayobjects.com/os/lib/react-dom/18.2.0/umd/react-dom.production.min.js',
|
||||
],
|
||||
copy: [
|
||||
{
|
||||
from: 'node_modules/monaco-editor/min/vs',
|
||||
to: 'static/dist/monaco-editor/min/vs',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
|
@ -36,7 +36,7 @@ const EditModal = ({
|
|||
const [value, setValue] = useState('');
|
||||
const [language, setLanguage] = useState<string>('javascript');
|
||||
const [cNode, setCNode] = useState<any>();
|
||||
const [selectedKey, setSelectedKey] = useState<string>('');
|
||||
const [selectedKey, setSelectedKey] = useState<string>();
|
||||
const [saveModalVisible, setSaveModalVisible] = useState<boolean>(false);
|
||||
const [settingModalVisible, setSettingModalVisible] =
|
||||
useState<boolean>(false);
|
||||
|
@ -148,7 +148,7 @@ const EditModal = ({
|
|||
<>
|
||||
<TreeSelect
|
||||
treeExpandAction="click"
|
||||
style={{ marginRight: 8, width: 150 }}
|
||||
style={{ marginRight: 8, width: 300 }}
|
||||
value={selectedKey}
|
||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||
treeData={treeData}
|
||||
|
@ -156,6 +156,7 @@ const EditModal = ({
|
|||
fieldNames={{ value: 'key', label: 'title' }}
|
||||
showSearch
|
||||
onSelect={onSelect}
|
||||
treeLine={{ showLeafIcon: true }}
|
||||
/>
|
||||
<Select
|
||||
value={language}
|
||||
|
|
|
@ -26,7 +26,7 @@ export function init(version: string) {
|
|||
// monaco 编辑器配置cdn和locale
|
||||
loader.config({
|
||||
paths: {
|
||||
vs: 'https://cdn.staticfile.org/monaco-editor/0.33.0/min/vs',
|
||||
vs: '/monaco-editor/min/vs',
|
||||
},
|
||||
'vs/nls': {
|
||||
availableLanguages: {
|
||||
|
|
Loading…
Reference in New Issue
Block a user