Closed yinLiangDream closed 5 years ago
具体场景是? 比如:特定小程序引入同一第三方组件还是跨小程序引用?
对于开发特定小程序引入同一第三方库情况是可以的,
eg:开发微信小程序时引入微信小程序第三方库: xxxx
ui 库 ;
使用方式:跟本地自定义组件一样,在 <script>
中 import
然后 在 components
上正常声明即可,
<template>
<view>
<ui-button type="primary" @click="handleClick">按钮</ui-button>
</view>
</template>
<script>
// 此路径 ui 库引用一致
import button from 'xxxx/dist/button';
export default {
// ...
components: {
'ui-button': button
},
// ...
methods: {
handleClick() {
// ...
}
}
};
</script>
对于跨小程序引用 暂时不支持
有时候需要用到第三方的组件库,文档里没有写明是否支持。