小程序交易保障標(biāo)展示組件為例
參考uniapp加載插件、微信小程序加載插件
1. manifest.json:
先打開(kāi)manifest.json文件,然后我們找到"mp-weixin",引入需要使用的插件文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-508417.html
"mp-weixin": {
/* 微信小程序特有相關(guān) */
"appid": "",
"setting": {
"urlCheck": false
},
"usingComponents": true,
"plugins": {
"shoppingGuarantee": {
"version": "latest",
"provider": "wxd65104595293601e"
}
}
},
2. pages.json
打開(kāi)pages.json文件,然后再對(duì)應(yīng)的頁(yè)面配置處添加?xùn)|西文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-508417.html
{
"path": "xxx",
"name": "xxx",
"style": {
"mp-weixin": {//微信插件
"usingComponents": {
"guarantee-bar": "plugin://shoppingGuarantee/guarantee-bar"
}
}
}
}
3.頁(yè)面使用
<template>
<guarantee-bar :pageType="pageType" :goodsName="goodsName" :goodsImg="goodsImg" :align="align" :spaceSize="spaceSize" :goodsPrice="goodsPrice" :bannerStyle="bannerStyle" />
</template>
<script>
export default {
data(){
return {
align: 'between',
spaceSize: 12,
bannerStyle: {
fontSize: 'normal',
fontOpacity: 'gray',
},
pageType: 'goods_detail',
goodsName: '微信氣泡狗零錢包',
goodsImg: 'https://xxxxx/',
goodsPrice: '28元'
}
}
}
</script>
到了這里,關(guān)于uniapp使用微信小程序提供的原生插件(組件)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!