Skip to content

Commit

Permalink
fix: replace fixed icon
Browse files Browse the repository at this point in the history
  • Loading branch information
yy-wow committed Nov 28, 2024
1 parent f1f1a7e commit a93cd1b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
17 changes: 17 additions & 0 deletions packages/design-core/assets/fixed-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 7 additions & 5 deletions packages/plugins/materials/src/components/header/Main.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<svg-button
class="item icon-sidebar"
:class="[fixedPanels?.includes(PLUGIN_NAME.Materials) && 'active']"
name="fixed"
:tips="!fixedPanels?.includes(PLUGIN_NAME.Materials) ? '固定面板' : '解除固定面板'"
:name="panelFixed ? 'fixed-solid' : 'fixed'"
:tips="panelFixed ? '解除固定面板' : '固定面板'"
@click="$emit('fixPanel', PLUGIN_NAME.Materials)"
></svg-button>
</template>

<script>
import { computed } from 'vue'
import { SvgButton } from '@opentiny/tiny-engine-common'
import { useLayout } from '@opentiny/tiny-engine-meta-register'
Expand All @@ -22,11 +22,13 @@ export default {
type: Array
}
},
setup() {
setup(props) {
const { PLUGIN_NAME } = useLayout()
const panelFixed = computed(() => props.fixedPanels?.includes(PLUGIN_NAME.Materials))
return {
PLUGIN_NAME
PLUGIN_NAME,
panelFixed
}
}
}
Expand Down
33 changes: 7 additions & 26 deletions packages/plugins/tree/src/Main.vue
Original file line number Diff line number Diff line change
@@ -1,33 +1,11 @@
<template>
<plugin-panel class="outlinebox" title="大纲树" @close="$emit('close')">
<template #header>
<!-- TODO 功能待实现 -->
<!-- <tiny-tooltip class="item" effect="dark" :content="state.expandAll ? '收缩' : '展开'" placement="bottom">
<span class="icon-ex" @click="toggleTree">
<svg-icon v-if="state.expandAll" name="expand"></svg-icon>
<svg-icon v-else name="collapse"></svg-icon>
</span>
</tiny-tooltip> -->
<!-- TODO: 保留备份,确认svg-button写法无问题后删除 -->
<!-- <tiny-tooltip
class="item"
effect="dark"
:content="!fixedPanels?.includes(PLUGIN_NAME.OutlineTree) ? '固定面板' : '解除固定面板'"
placement="bottom"
>
<span
:class="['icon-sidebar', fixedPanels?.includes(PLUGIN_NAME.OutlineTree) && 'active']"
@click="$emit('fixPanel', PLUGIN_NAME.OutlineTree)"
>
<svg-icon name="fixed"></svg-icon>
</span>
</tiny-tooltip> -->
<svg-button
class="item icon-sidebar"
:class="[fixedPanels?.includes(PLUGIN_NAME.OutlineTree) && 'active']"
:tips="!fixedPanels?.includes(PLUGIN_NAME.OutlineTree) ? '固定面板' : '解除固定面板'"
:name="panelFixed ? 'fixed-solid' : 'fixed'"
:tips="panelFixed ? '解除固定面板' : '固定面板'"
@click="$emit('fixPanel', PLUGIN_NAME.OutlineTree)"
name="fixed"
></svg-button>
</template>
<template #content>
Expand Down Expand Up @@ -97,9 +75,12 @@ export default {
}
},
emits: ['close', 'fix-panel'],
setup() {
setup(props) {
const { pageState, getInstance } = useCanvas()
const { getMaterial } = useMaterial()
const { PLUGIN_NAME } = useLayout()
const panelFixed = computed(() => props.fixedPanels?.includes(PLUGIN_NAME.OutlineTree))
const filterSchema = (data) => {
const translateChild = (data) => {
Expand All @@ -121,7 +102,6 @@ export default {
return [{ ...translateChild([extend(true, {}, data)])[0], componentName: 'body' }]
}
const { PLUGIN_NAME } = useLayout()
const state = reactive({
pageSchema: [],
expandAll: true,
Expand Down Expand Up @@ -285,6 +265,7 @@ export default {
})
return {
panelFixed,
checkElement,
mouseover,
mouseleave,
Expand Down

0 comments on commit a93cd1b

Please sign in to comment.