怎么在微信小程序中使用自定義模版?針對這個(gè)問題,這篇文章詳細(xì)介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個(gè)問題的小伙伴找到更簡單易行的方法。
創(chuàng)新互聯(lián)堅(jiān)持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:網(wǎng)站設(shè)計(jì)制作、做網(wǎng)站、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿足客戶于互聯(lián)網(wǎng)時(shí)代的曲江網(wǎng)站設(shè)計(jì)、移動(dòng)媒體設(shè)計(jì)的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!1、新建一個(gè)wxml(為測試方便,這里將wxml文件建立在home目錄下)
/home/home/botmenu.wxml:
<template name="bottommenu"> <view class="bottomposition"> <navigator class="item_info" url="../home/home"> <image src="../img/sy.png"></image> <text>首頁</text> </navigator> <navigator class="item_info" url="/pages/home/home"> <image src="../img/xx.png"></image> <text>消息</text> </navigator> <navigator class="item_info" url="/pages/home/home"> <image src="../img/lz.png"></image> <text>工具</text> </navigator> <navigator class="item_info" url="/pages/home/home"> <image src="../img/wo.png"></image> <text>我</text> </navigator> </view> </template>
2、新建wxss
/home/home/botmenu.wxss:
.bottomposition{ width: 100%; height: 10%; position: fixed; overflow: hidden; left: 0; top: 90%; z-index: 1100; display: flex; border-top: 1rpx solid #dadada; } .item_info { width: 25%; height: 100%; display: flex; align-items: center; flex-direction: column; justify-content: center; } .item_info image { width: 20px; height: 20px; } .item_info text { margin-top: 5px; font-size: 12px; } .infolist{ margin:10px; padding: 0 10px; font-size: 12px; }
3、頁面引用
<import src="../home/home.wxml"/> <view class="info"> <template is="bottommenu"></template> </view>
4、頁面樣式引用
@import "../home/home.wxss";
5、index.js中的data數(shù)據(jù):
data: { tool_list:[{ name:"在線JavaScript代碼美化、格式化工具", url:"http://tools.jb51.net/code/js" },{ name:"json代碼在線格式化/美化/壓縮/編輯/轉(zhuǎn)換工具", url:"http://tools.jb51.net/code/jsoncodeformat" },{ name:"中文繁體字簡體字轉(zhuǎn)換(繁簡轉(zhuǎn)換)工具", url:"http://tools.jb51.net/transcoding/convertzh" },{ name:"正則表達(dá)式在線生成工具", url:"http://tools.jb51.net/regex/create_reg" },{ name:"XML代碼在線格式化美化工具", url:"http://tools.jb51.net/code/xmlcodeformat" },{ name:"在線科學(xué)計(jì)算器", url:"http://tools.jb51.net/jisuanqi/jsqkexue" },{ name:"BASE64編碼解碼工具", url:"http://tools.jb51.net/transcoding/base64" }] },
6、index.wxml
<!--index.wxml--> <view class='userinfo'>創(chuàng)新互聯(lián)成都網(wǎng)站設(shè)計(jì)公司在線工具</view> <view wx:for="{{tool_list}}" class="infolist"> <text>{{item.name}} - {{item.url}}</text> </view> <import src="../home/home.wxml"/> <view class="info"> <template is="bottommenu"></template> </view>
關(guān)于怎么在微信小程序中使用自定義模版問題的解答就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注創(chuàng)新互聯(lián)成都網(wǎng)站設(shè)計(jì)公司行業(yè)資訊頻道了解更多相關(guān)知識。
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
新聞標(biāo)題:怎么在微信小程序中使用自定義模版-創(chuàng)新互聯(lián)
轉(zhuǎn)載源于:http://vcdvsql.cn/article30/ddjjso.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供小程序開發(fā)、網(wǎng)頁設(shè)計(jì)公司、品牌網(wǎng)站制作、響應(yīng)式網(wǎng)站、商城網(wǎng)站、用戶體驗(yàn)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容