没有合适的资源?快使用搜索试试~ 我知道了~
小程序引用外部js //封装的函数 function GetUserInfo2018() { console.log(获取用户信息8888) } function count(str) { console.log(str) } //转化成小程序模板语言 这一步非常重要 不然无法正确调用 module.exports = { GetUserInfo2018: GetUserInfo2018, count: count }; /*其它页面调用 var common = require(../common/common.js); common.GetUserInfo2018(
资源推荐
资源详情
资源评论
微信小程序如何引用外部微信小程序如何引用外部js,外部样式,公共页面模板,外部样式,公共页面模板
小程序引用外部小程序引用外部js
//封装的函数
function GetUserInfo2018() {
console.log("获取用户信息8888")
}
function count(str) {
console.log(str)
}
//转化成小程序模板语言 这一步非常重要 不然无法正确调用
module.exports = {
GetUserInfo2018: GetUserInfo2018,
count: count
};
/*其它页面调用
var common = require("../common/common.js");
common.GetUserInfo2018();
common.count("hehe");
*/
小程序引用外部小程序引用外部css
/*
app.wxss是全局样式,作用于每一个页面,
而page下的每一个的wxss文件只作用于当前页面,并对全局样式中的相同属性会覆盖
*/
@import "../../app.wxss";
/**index.wxss**/
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
}
.userinfo-avatar {
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 20%;
}
.userinfo-nickname {
color: #aaa;
}
.usermotto {
margin-top: 200px;
}
小程序引用公共页面小程序引用公共页面
1、不带参数、不带参数
首先在pages文件夹中新建一个template文件夹,文件夹中新建一个template.wxml文件,代码如下
<!--template.wxml-->
<template name="msgItem">
<view>
<text>This is template.wxml文件,我是一个模板</text>
</view>
</template>
然后我们书写我们所要调用template的页面index.wxml
<!--index.wxml-->
资源评论
weixin_38692162
- 粉丝: 4
- 资源: 904
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功