diff --git a/packages/common/component/MonacoEditor.vue b/packages/common/component/MonacoEditor.vue index 58f370169..ffa33cc3d 100644 --- a/packages/common/component/MonacoEditor.vue +++ b/packages/common/component/MonacoEditor.vue @@ -1,32 +1,36 @@ @@ -164,6 +168,11 @@ export default { } } +.editor-container-content { + flex: 1; + overflow: hidden; +} + .editor { flex: 1; overflow: hidden; diff --git a/packages/plugins/state/src/CreateStore.vue b/packages/plugins/state/src/CreateStore.vue index ec55cb924..a09a3d633 100644 --- a/packages/plugins/state/src/CreateStore.vue +++ b/packages/plugins/state/src/CreateStore.vue @@ -13,8 +13,8 @@ - - + +
+ +
-
-
字符串:"string"
-
数字:123
-
布尔值:true/false
-
对象:{"name":"xxx"}
-
数组:["1","2"]
-
空值:null
-
"color":red
-
"background":"blue"
-
+
- - - + + + + + - - - + + + + +
@@ -65,10 +72,14 @@ import { Form, FormItem, Input, Collapse as TinyCollapse, CollapseItem as TinyCo import { MonacoEditor } from '@opentiny/tiny-engine-common' import { string2Ast, ast2String, insertName } from '@opentiny/tiny-engine-common/js/ast' import { verifyJsVarName } from '@opentiny/tiny-engine-common/js/verification' +import StateTips from './StateTips.vue' +import StateFullscreenHead from './StateFullscreenHead.vue' export default { components: { MonacoEditor, + StateTips, + StateFullscreenHead, TinyForm: Form, TinyFormItem: FormItem, TinyInput: Input, @@ -89,7 +100,11 @@ export default { type: String } }, + emits: ['close'], setup(props, { emit }) { + const STATE = 'state' + const GETTERS = 'getters' + const ACTIONS = 'actions' const instance = getCurrentInstance() const isDemoShow = ref(false) const gettersEditor = ref(null) @@ -205,7 +220,14 @@ export default { return Object.prototype.toString.call(variable) === '[object Object]' } + const cancel = () => { + emit('close') + } + return { + STATE, + GETTERS, + ACTIONS, isDemoShow, state, getEditor, @@ -219,7 +241,8 @@ export default { actionsEditor, editorDidMount, variableEditor, - actions + actions, + cancel } } } @@ -229,15 +252,6 @@ export default { .store-form { height: calc(100% - 45px); overflow-y: auto; - .tips { - font-size: 11px; - line-height: 18px; - margin-top: 8px; - border-radius: 4px; - padding: 8px 14px; - background: var(--ti-lowcode-data-source-box-bg); - color: var(--ti-lowcode-datasource-tip-color); - } :deep(.tiny-collapse-item__wrap) { padding: 0 12px; } diff --git a/packages/plugins/state/src/CreateVariable.vue b/packages/plugins/state/src/CreateVariable.vue index 53b65ecad..4614d61fc 100644 --- a/packages/plugins/state/src/CreateVariable.vue +++ b/packages/plugins/state/src/CreateVariable.vue @@ -19,7 +19,7 @@ - + - + + -
-
字符串:"string"
-
数字:123
-
布尔值:true/false
-
对象:{"name":"xxx"}
-
数组:["1","2"]
-
空值:null
-
"color":red
-
"background":"blue"
-
+
- + -