Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function defaultRenderer(schema, refreshKey, entry, active, isPage = true) {
const rootChildrenSchema = {
id: 0,
componentName: 'div',
componentType: 'PageSection',
// 手动添加一个唯一的属性,后续在画布选中此节点时方便处理额外的逻辑。由于没有修改schema,不会影响出码
props: { ...schema.props, 'data-id': 'root-container', 'data-page-active': active },
children: schema.children
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import postcss from 'postcss'
import scopedPlugin from './scope-css-plugin'

export function handleScopedCss(id: string, content: string) {
return postcss([scopedPlugin(id)]).process(content)
return postcss([scopedPlugin(id)]).process(content, { from: undefined })
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const wrapPageComponent = (pageId: string) => {
() => active.value,
(activeValue) => {
if (!activeValue) {
asyncData.value = null
updateSchema()
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/canvas/render/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const checkGroup = (componentName) => configure[componentName]?.nestingRule?.chi
const clickCapture = (componentName) => configure[componentName]?.clickCapture !== false

const getBindProps = (schema, scope, context, pageContext) => {
const { id, componentName } = schema
const { id, componentName, componentType } = schema
const invalidity = configure[componentName]?.invalidity || []

if (componentName === 'CanvasPlaceholder') {
Expand Down Expand Up @@ -120,7 +120,7 @@ const getBindProps = (schema, scope, context, pageContext) => {
delete bindProps.className

// 使画布中元素可拖拽
if (active) {
if (active && !['PageStart', 'PageSection'].includes(componentType)) {
bindProps.draggable = true
}

Expand Down
Loading