feat: fix type
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<script setup lang="ts">
|
||||
import JSWidget from '@/components/widget/JSwidget.vue';
|
||||
|
||||
const widgetOptions = {
|
||||
"locale": "vi",
|
||||
"price_line_color": "#71BDDF",
|
||||
"grid_color": "#999999",
|
||||
"label_color": "#999999",
|
||||
"width": "350px",
|
||||
"height": "250px"
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
<JSWidget
|
||||
CONTAINER_ID="default_widget_[123123]"
|
||||
SCRIPT_ID="12312312"
|
||||
SCRIPT_SRC="https://www.fireant.vn/Scripts/web/widgets.js"
|
||||
:options="widgetOptions"
|
||||
widgetKey="FireAnt"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
div {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
background-color: #ededed;
|
||||
font-size: 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1 @@
|
||||
export { default as Stock_Default } from './334x641.vue'
|
||||
@@ -0,0 +1,34 @@
|
||||
<script lang="ts" setup>
|
||||
import { enumPageComponentTemplate, enumPageComponentKey, enumPageComponentLayouts } from "@/definitions/enum";
|
||||
import { Stock_Default } from "./index";
|
||||
|
||||
const _props = defineProps<{
|
||||
settings: any;
|
||||
component?: any;
|
||||
content?: any;
|
||||
}>();
|
||||
const definedDynamicComponent: Record<string, any> = {
|
||||
[enumPageComponentLayouts[enumPageComponentTemplate[enumPageComponentKey.OTHER]['STOCK']]['STOCK_DEFAULT']]: Stock_Default,
|
||||
};
|
||||
|
||||
const getCurrentComponent = computed(() => `${_props.settings.layout}`);
|
||||
const GET_PROPS = computed(() => {
|
||||
return () => {
|
||||
let props: any = {};
|
||||
if (_props.settings) {
|
||||
for (const [key, value] of Object.entries(_props.settings)) {
|
||||
props = {
|
||||
...props,
|
||||
[key]: value,
|
||||
};
|
||||
}
|
||||
return props;
|
||||
}
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<component :is="definedDynamicComponent[getCurrentComponent]" v-bind="{ ...GET_PROPS(), component: _props.component, settings: _props.settings }" />
|
||||
</template>
|
||||
../stocks/index
|
||||
Reference in New Issue
Block a user