Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yma16
yma16_miniprogram
提交
af02b6a4
Y
yma16_miniprogram
项目概览
yma16
/
yma16_miniprogram
通知
11
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
yma16_miniprogram
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
af02b6a4
编写于
8月 01, 2022
作者:
yma16
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
gitcode
gitcode
上级
1d226ec5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
63 addition
and
11 deletion
+63
-11
miniprogram/app.js
miniprogram/app.js
+20
-0
miniprogram/pages/homeContent/homeContent.js
miniprogram/pages/homeContent/homeContent.js
+27
-6
miniprogram/pages/homeContent/homeContent.json
miniprogram/pages/homeContent/homeContent.json
+3
-1
miniprogram/pages/homeContent/homeContent.wxml
miniprogram/pages/homeContent/homeContent.wxml
+13
-4
未找到文件。
miniprogram/app.js
浏览文件 @
af02b6a4
...
...
@@ -71,6 +71,26 @@ App({
this
.
globalData
=
{
setting
:
setting
};
console
.
log
(
'
onLaunch
'
,
options
)
},
//
// 引入`towxml3.0`解析方法
towxml
:
require
(
'
/towxml/index
'
),
//声明一个数据请求方法
getText
:
(
url
,
callback
)
=>
{
wx
.
request
({
url
:
url
,
header
:
{
'
content-type
'
:
'
application/x-www-form-urlencoded
'
},
success
:
(
res
)
=>
{
if
(
typeof
callback
===
'
function
'
)
{
callback
(
res
);
};
}
});
},
onShow
(
options
)
{
// Do something when show.
console
.
info
(
'
show
'
,
options
)
...
...
miniprogram/pages/homeContent/homeContent.js
浏览文件 @
af02b6a4
...
...
@@ -18,20 +18,41 @@ Page({
*/
data
:
{
content
:
'
子组件的content
'
,
homeHeaderItem
:
''
homeHeaderItem
:
''
,
isLoading
:
true
,
article
:
{}
},
observers
:{
},
/**
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
console
.
log
(
'
进入homePage home-content 渲染开始 onload
'
)
console
.
log
(
'
传递的header-item
'
,
options
,
this
)
onLoad
:
function
()
{
const
_ts
=
this
;
app
.
getText
(
'
https://www.vvadd.com/wxml_demo/demo.txt?v=2
'
,
res
=>
{
let
obj
=
app
.
towxml
(
res
.
data
,
'
markdown
'
,{
// theme:'dark',
events
:{
tap
:
e
=>
{
console
.
log
(
'
tap
'
,
e
);
},
change
:
e
=>
{
console
.
log
(
'
todo
'
,
e
);
}
}
});
_ts
.
setData
({
article
:
obj
,
isLoading
:
false
});
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
...
...
miniprogram/pages/homeContent/homeContent.json
浏览文件 @
af02b6a4
{
"navigationBarBackgroundColor"
:
"#ffffff"
,
"navigationBarTextStyle"
:
"black"
,
"usingComponents"
:
{
"towxml"
:
"/towxml/towxml"
}
}
\ No newline at end of file
miniprogram/pages/homeContent/homeContent.wxml
浏览文件 @
af02b6a4
<!--pages/homeContent/homeContent.wxml-->
<!-- <text>pages/homeContent/homeContent.wxml</text> -->
<
view class="container"
>
<
text>content内容</text
>
{{headerItem}}
{{content + headerItem}}
<
!-- <view class="container"> --
>
<
!-- <text>content内容</text> --
>
<!-- {{headerItem}} -->
<!-- {{content + headerItem}} -->
<!-- <web-view src="https://yongma16.xyz/" /> -->
<!-- </view> -->
<!--index.wxml-->
<!--loading-->
<view class="loading" wx:if="{{isLoading}}">
<image class="loading__icon" src="/images/loading.svg"></image>
</view>
<!--使用towxml-->
<towxml nodes="{{article}}"/>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录