mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
feat(editor,ui): 页面片下拉选择框支持点击跳转编辑,修改页面片组件initvalue
This commit is contained in:
parent
2dcef449bf
commit
2dc810a9fd
@ -9,16 +9,20 @@
|
||||
:size="size"
|
||||
@change="changeHandler"
|
||||
></m-form-container>
|
||||
<!-- 编辑按钮 -->
|
||||
<Icon v-if="model[name]" class="icon" :icon="Edit" @click="editPageFragment(model[name])"></Icon>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, inject } from 'vue';
|
||||
import { Edit } from '@element-plus/icons-vue';
|
||||
|
||||
import { FieldProps } from '@tmagic/form';
|
||||
import { NodeType } from '@tmagic/schema';
|
||||
import { Id, NodeType } from '@tmagic/schema';
|
||||
|
||||
import Icon from '@editor/components/Icon.vue';
|
||||
import type { PageFragmentSelectConfig, Services } from '@editor/type';
|
||||
|
||||
defineOptions({
|
||||
@ -41,8 +45,8 @@ const selectConfig = {
|
||||
options: () => {
|
||||
if (pageList.value) {
|
||||
return pageList.value.map((item) => ({
|
||||
text: `${item.name}(${item.id})`,
|
||||
label: `${item.name}(${item.id})`,
|
||||
text: `${item.devconfig?.tabName || item.title || item.name}(${item.id})`,
|
||||
label: `${item.devconfig?.tabName || item.title || item.name}(${item.id})`,
|
||||
value: item.id,
|
||||
}));
|
||||
}
|
||||
@ -52,4 +56,8 @@ const selectConfig = {
|
||||
const changeHandler = async () => {
|
||||
emit('change', props.model[props.name]);
|
||||
};
|
||||
|
||||
const editPageFragment = (id: Id) => {
|
||||
services?.editorService.select(id);
|
||||
};
|
||||
</script>
|
||||
|
14
packages/editor/src/theme/page-fragment-select.scss
Normal file
14
packages/editor/src/theme/page-fragment-select.scss
Normal file
@ -0,0 +1,14 @@
|
||||
.m-fields-page-fragment-select {
|
||||
width: 100%;
|
||||
.page-fragment-select-container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.select {
|
||||
flex: 1;
|
||||
}
|
||||
.icon {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
@ -24,3 +24,4 @@
|
||||
@import "./floatbox.scss";
|
||||
@import "./tree.scss";
|
||||
@import "./floating-box.scss";
|
||||
@import "./page-fragment-select.scss";
|
||||
|
@ -20,6 +20,6 @@ export default {
|
||||
items: [],
|
||||
style: {
|
||||
width: '375',
|
||||
height: '950',
|
||||
height: '817',
|
||||
},
|
||||
};
|
||||
|
@ -20,6 +20,6 @@ export default {
|
||||
items: [],
|
||||
style: {
|
||||
width: '375',
|
||||
height: '950',
|
||||
height: '817',
|
||||
},
|
||||
};
|
||||
|
@ -20,6 +20,6 @@ export default {
|
||||
items: [],
|
||||
style: {
|
||||
width: '375',
|
||||
height: '950',
|
||||
height: '817',
|
||||
},
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user