微信小程序引用自定義組件


在微信小程序官方文檔中的擴展能力模塊,有weui的組件庫。

我們可以在這里下載組件,以slideview為例。

在小程序根目錄下新建components文件夾,下載cell、cells、slideview放到該文件夾中,

在需要使用組件的頁面的json文件中加上

{
  "usingComponents": {
    "mp-cells": "../components/cells/cells",
    "mp-cell": "../components/cell/cell",
    "mp-slideview": "../components/slideview/slideview"
  }
}

在頁面上加入組件的wxml和js,即可使用該組件。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM