vue-yun-com 动态加载远端组件
Attributes
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
_name | 云组件名称 | string | — | — |
_unit | 云组件名称 | string | [px, rem] | px |
Installation
npm:
npm i vue-yun-com -S
component register [global or partial]
import YunCom from 'vue-yun-com';
// global register
Vue.component([YunCom.name]: YunCom)
// or partial regisger
export default {
components: {
[YunCom.name]: YunCom
}
}
Usage
<template>
<YunCom v-model="status" _name="VmSwitch"></YunCom>
</template>
<script>
import YunCom from 'vue-yun-com'
export default {
data () {
return {
status: false
}
},
components: {
YunCom
}
}
</script>