0.0.32 • Published 1 year ago

sightwise-card-plugin-vue v0.0.32

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year 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.32

1 year ago

0.0.31

1 year ago

0.0.30

1 year ago

0.0.28

1 year ago

0.0.29

1 year ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.26

1 year ago

0.0.27

1 year ago

0.0.23

2 years ago

0.0.21

2 years ago

0.0.22

2 years ago

0.0.20

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

1.0.0

2 years ago