mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-07 20:06:08 +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/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',
|
'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 [value, setValue] = useState('');
|
||||||
const [language, setLanguage] = useState<string>('javascript');
|
const [language, setLanguage] = useState<string>('javascript');
|
||||||
const [cNode, setCNode] = useState<any>();
|
const [cNode, setCNode] = useState<any>();
|
||||||
const [selectedKey, setSelectedKey] = useState<string>('');
|
const [selectedKey, setSelectedKey] = useState<string>();
|
||||||
const [saveModalVisible, setSaveModalVisible] = useState<boolean>(false);
|
const [saveModalVisible, setSaveModalVisible] = useState<boolean>(false);
|
||||||
const [settingModalVisible, setSettingModalVisible] =
|
const [settingModalVisible, setSettingModalVisible] =
|
||||||
useState<boolean>(false);
|
useState<boolean>(false);
|
||||||
|
@ -148,7 +148,7 @@ const EditModal = ({
|
||||||
<>
|
<>
|
||||||
<TreeSelect
|
<TreeSelect
|
||||||
treeExpandAction="click"
|
treeExpandAction="click"
|
||||||
style={{ marginRight: 8, width: 150 }}
|
style={{ marginRight: 8, width: 300 }}
|
||||||
value={selectedKey}
|
value={selectedKey}
|
||||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||||
treeData={treeData}
|
treeData={treeData}
|
||||||
|
@ -156,6 +156,7 @@ const EditModal = ({
|
||||||
fieldNames={{ value: 'key', label: 'title' }}
|
fieldNames={{ value: 'key', label: 'title' }}
|
||||||
showSearch
|
showSearch
|
||||||
onSelect={onSelect}
|
onSelect={onSelect}
|
||||||
|
treeLine={{ showLeafIcon: true }}
|
||||||
/>
|
/>
|
||||||
<Select
|
<Select
|
||||||
value={language}
|
value={language}
|
||||||
|
|
|
@ -26,7 +26,7 @@ export function init(version: string) {
|
||||||
// monaco 编辑器配置cdn和locale
|
// monaco 编辑器配置cdn和locale
|
||||||
loader.config({
|
loader.config({
|
||||||
paths: {
|
paths: {
|
||||||
vs: 'https://cdn.staticfile.org/monaco-editor/0.33.0/min/vs',
|
vs: '/monaco-editor/min/vs',
|
||||||
},
|
},
|
||||||
'vs/nls': {
|
'vs/nls': {
|
||||||
availableLanguages: {
|
availableLanguages: {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user