(精华)2020年7月30日 微信小程序 模块的使用
发布日期:2021-06-29 15:08:30 浏览次数:3 分类:技术文章

本文共 506 字,大约阅读时间需要 1 分钟。

WXS 模块

tools.wxs

var foo = "'hello world' from comm.wxs";var bar = function(d) {
return d;}module.exports = {
foo: foo, bar: bar};module.exports.msg = "some msg";

logic.wxs

var tools = require("./tools.wxs");console.log(tools.FOO);console.log(tools.bar("logic.wxs"));console.log(tools.msg);

使用

//
{
{
tools.msg}}
{
{
tools.bar(tools.FOO)}}

在单个页面使用

var some_msg = "hello world";module.exports = {
msg : some_msg,}
{
{
foo.msg}}

转载地址:https://codeboy.blog.csdn.net/article/details/107684362 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:(精华)2020年7月30日 微信小程序 视图容器
下一篇:(精华)2020年7月29日 React react-hooks的useReducer的使用

发表评论

最新留言

网站不错 人气很旺了 加油
[***.192.178.218]2024年04月30日 20时04分34秒