2023-07-01 16:22:24 +08:00

39 lines
918 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view :style="warpCss">
固定模板示例我也可以装修
我定义的数据源{{ diyComponent.componentName }}
</view>
</template>
<script setup lang="ts">
import { computed, watch } from 'vue';
import useDiyStore from '@/stores/diy';
const props = defineProps(['component', 'index', 'pullDownRefresh']);
const diyStore = useDiyStore();
const diyComponent = computed(() => {
if (diyStore.mode == 'decorate') {
return diyStore.value[props.index];
} else {
return props.component;
}
})
const warpCss = computed(() => {
var style = '';
style += 'height:' + diyComponent.value.height * 2 + 'rpx;';
if (diyComponent.value.componentBgColor) style += 'background-color:' + diyComponent.value.componentBgColor + ';';
return style;
})
watch(
() => props.pullDownRefresh,
(newValue, oldValue) => {
// 处理下拉刷新业务
}
)
</script>
<style></style>