index.vue 704 B

12345678910111213141516171819202122232425262728
  1. <template>
  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. // TODO @疯狂:idea 有告警
  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. <style scoped lang="scss"></style>