I created views in my app.js file
var mainView = app.views.create('#tab1',{
url: '/'
});
var zbView = app.views.create('#tab2', {
url: '/tab2/'
});
var lmView = app.views.create('#tab3', {
url: '/tab3/'
});
var spView = app.views.create('#tab4', {
url: '/tab4/'
});
,and added data.product
var $$ = Dom7;
var app = new Framework7({
// App root element
root: '#app',
// App Name
name: 'My App',
// App id
id: 'com.myapp.test',
theme:'auto',
// Enable swipe panel
panel: {
swipe: 'left',
},
notification: {
title: 'My App',
closeTimeout: 3000,
},
data:function(){
return {
products:[
{
id:'1',
TvPopname:'.popup-about',
TvAvatar: '../images/min-video-4.jpg',
TvTitle: '新闻综合',
TvDescription:'正在直播'
},
{
id:'2',
TvPopname:'.popup-about',
TvAvatar: '../images/min-video-4.jpg',
TvTitle: '新闻综合',
TvDescription:'正在直播'
},
{
id:'3',
TvPopname:'.popup-about',
TvAvatar: '../images/min-video-4.jpg',
TvTitle: '新闻综合',
TvDescription:'正在直播'
}
]
};
},
routes:routes,
});
But my page data can’t be parsed,it’s my page tab2
{{#each product}}
< li >
< a href="/product/{{id}}/" >
< div class=“item-media”><img src="{{TvAvatar}}"/ >< /div >
< div class=“item-inner” style=“line-height: 41px;” >
< div class=“item-title-row” >
< div class=“item-title” >{{TvTitle}}< /div >
< /div >
< div class=“item-subtitle” style=“color: #0093FF;” >{{TvDescription}}< /div >
< span style=“position: absolute;top: 50%;right: 10px;margin-top: -10px;” >< i class=“f7-icons” style=“color: red;” >play< /i >< /span >
< /div >
< /a >
< /li >
{{/each}}
<script type="text/javascript">
alert(111);//here cannot be popup,it didn't come in
return {
data: function () {
return {
products: this.$root.products,
};
}
};
</script>
**this is my project, **
If you’ve ever had this problem or know how to fix it , plz tell me ,thank u !!