Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: The style configuration binding variable component reads the configurator configuration #949

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/canvas/common/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const copyObject = (node) => {
*/
export const dynamicImportComponents = async ({ package: pkg, script, components }) => {
if (!script) return
const href = window.parent.location.href || location.href; // 这里要取父窗口的地址,因为在iframe中href是about:srcdoc
const href = window.parent.location.href || location.href // 这里要取父窗口的地址,因为在iframe中href是about:srcdoc
const scriptUrl = script.startsWith('.') ? new URL(script, href).href : script

if (!window.TinyComponentLibs[pkg]) {
Expand Down
22 changes: 12 additions & 10 deletions packages/settings/styles/src/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<div class="line-style">
<span class="line-text"> 行内样式 </span>
<div class="inline-style">
<code-configurator
<component
:is="CodeConfigurator"
v-if="state.lineStyleDisable"
:buttonShowContent="true"
:modelValue="state.styleContent"
Expand All @@ -12,17 +13,18 @@
language="css"
single
@save="save"
/>
></component>
<div v-if="!state.lineStyleDisable">
<tiny-input v-model="state.propertiesList" class="inline-bind-style"> </tiny-input>
</div>
<variable-configurator
<component
:is="VariableConfigurator"
ref="bindVariable"
:model-value="state.bindModelValue"
name="advance"
@update:modelValue="setConfig"
>
</variable-configurator>
</component>
</div>
</div>
</div>
Expand Down Expand Up @@ -67,8 +69,7 @@
<script>
import { watch, inject, ref } from 'vue'
import { Collapse, CollapseItem, Input } from '@opentiny/vue'
import { useHistory, useCanvas, useProperties } from '@opentiny/tiny-engine-meta-register'
import { CodeConfigurator, VariableConfigurator } from '@opentiny/tiny-engine-configurator'
import { useHistory, useCanvas, useProperties, getConfigurator } from '@opentiny/tiny-engine-meta-register'
import {
SizeGroup,
LayoutGroup,
Expand All @@ -88,7 +89,6 @@ import { styleStrRemoveRoot } from './js/cssConvert'

export default {
components: {
CodeConfigurator,
SizeGroup,
LayoutGroup,
FlexBox,
Expand All @@ -102,11 +102,11 @@ export default {
ClassNamesContainer,
TinyCollapse: Collapse,
TinyCollapseItem: CollapseItem,
TinyInput: Input,
VariableConfigurator
TinyInput: Input
},
props: {},
setup() {
const CodeConfigurator = getConfigurator('CodeConfigurator')
const VariableConfigurator = getConfigurator('VariableConfigurator')
const styleCategoryGroup = [
'layout',
'spacing',
Expand Down Expand Up @@ -208,6 +208,8 @@ export default {
)

return {
CodeConfigurator,
VariableConfigurator,
state,
activeNames,
CSS_TYPE,
Expand Down
Loading