0.0.31 • Published 2 months ago

sightwise-card-plugin-vue v0.0.31

Weekly downloads
-
License
ISC
Repository
-
Last release
2 months ago

安装

// with npm
npm install sightwise-card-plugin-vue

// with pnpm
pnpm add sightwise-card-plugin-vue

Vue2使用示例

<script>
import axios from 'axios'
import { SCard } from 'sightwise-card-plugin-vue'

import 'sightwise-card-plugin-vue/sightwise-card-plugin.css' // 引入组件样式

export default {
  components: {
    SCard
  },
  data() {
    return {
      request: axios.create({
        baseURL: '/api/CardCenter',
        headers: {
          'User-Token': '123',
        },
      }),
      darkMode: false,
      query: { delta: -1000 }
    }
  },
}
</script>

<template>
  <div class="card-preview-container">
    <SCard
      card-id="1726503566417334274"
      :request="request" 
      :dark-mode="darkMode" 
      :query="query" 
    />
  </div>
</template>

<style lang="less">
  .card-preview-container {
    background-color: #E4E5EB;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 100%;
    padding: 24px;
    gap: 16px;
  }
</style>

API

Props

参数名描述类型默认值
cardId渲染卡片的IDstring-
requestAxios实例AxiosInstance-
query查询变量object-
showMode显示模式'normal' | 'static''normal'
darkMode暗黑模式booleanfalse
hideTitle隐藏标题booleanfalse
lazyLoad懒加载,出现在可视区发起请求booleanfalse
dataView查看数据模式booleanfalse
prefixUrlurl前置地址,优先级大于原配置string-

Events

事件名描述参数
after-get-card获取卡片数据成功后object
after-get-dataset获取卡片关联数据集数据成功后object
card-ready卡片所有接口请求完成后object

注意

不要用在外层使用display: none去隐藏卡片,显隐时会导致卡片多次渲染 例如,在ant-desgin-vue@3.2.11中,默认会使用display: none隐藏tab-pane,此时需要开启animated配置

0.0.31

2 months ago

0.0.30

2 months ago

0.0.28

3 months ago

0.0.29

3 months ago

0.0.24

4 months ago

0.0.25

4 months ago

0.0.26

4 months ago

0.0.27

4 months ago

0.0.23

4 months ago

0.0.21

5 months ago

0.0.22

5 months ago

0.0.20

5 months ago

0.0.17

5 months ago

0.0.18

5 months ago

0.0.19

5 months ago

0.0.16

5 months ago

0.0.15

5 months ago

0.0.14

6 months ago

0.0.13

6 months ago

0.0.12

6 months ago

0.0.11

6 months ago

0.0.10

6 months ago

0.0.9

7 months ago

0.0.8

7 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago

1.0.0

8 months ago