0.1.5 • Published 3 years ago
aiot-studio-render v0.1.5
Install
npm install aiot-studio-anonymous -S
npm install aiot-studio-render -S
Quick Start
- 1、全局注册组件aiot-studio-anonymous
// main.ts
import { Anonymous } from '@aiot/studio-anonymous'
Vue.component('anonymous-component', Anonymous)
- 2、在window上挂载vue实例
// main.ts
declare var window: any
window.Vue = Vue
- 3、使用渲染组件aiot-studio-render
<template>
<preview-comp
:components="components"
:setting="setting"
></preview-comp>
</template>
<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'
import { PreviewComp } from 'aiot-studio-render'
@Component({ components: {
PreviewComp
} })
export default class PageName extends Vue {
// 属性components和setting 由可视化项目的提供的接口获得
private components = []
private setting = {}
}
</script>