提交 | 用户 | 时间
|
820397
|
1 |
<template> |
H |
2 |
<div class="min-h-30px" v-html="article?.content"></div> |
|
3 |
</template> |
|
4 |
<script setup lang="ts"> |
|
5 |
import { PromotionArticleProperty } from './config' |
|
6 |
import * as ArticleApi from '@/api/mall/promotion/article/index' |
|
7 |
|
|
8 |
/** 营销文章 */ |
|
9 |
defineOptions({ name: 'PromotionArticle' }) |
|
10 |
// 定义属性 |
|
11 |
const props = defineProps<{ property: PromotionArticleProperty }>() |
|
12 |
// 商品列表 |
|
13 |
const article = ref<ArticleApi.ArticleVO>() |
|
14 |
watch( |
|
15 |
() => props.property.id, |
|
16 |
async () => { |
|
17 |
if (props.property.id) { |
|
18 |
article.value = await ArticleApi.getArticle(props.property.id) |
|
19 |
} |
|
20 |
}, |
|
21 |
{ |
|
22 |
immediate: true |
|
23 |
} |
|
24 |
) |
|
25 |
</script> |
|
26 |
|
|
27 |
<style scoped lang="scss"></style> |