Skip to content

Commit

Permalink
fix: The style configuration binding variable component reads the con…
Browse files Browse the repository at this point in the history
…figurator configuration (#949)
  • Loading branch information
yy-wow authored Jan 14, 2025
1 parent 8295c3f commit 3674f83
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
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

0 comments on commit 3674f83

Please sign in to comment.