Vue page for reading database information in app development

Source: Internet
Author: User

<template>
<!--Containers--
<div class= "Container" >

<!--headers--
<div class= "header": style= "{height:height}" >
<wxc-minibar background-color= "#fff"
Text-color= "#1a1a1a"
: title= "Titles"
@wxcMinibarLeftButtonClicked = "Minibarleftbuttonclick" >

<!--picture location--
<image slot= "right" @click = "jump (' Employedit ')" class= "Icon-add" src= "... /.. /.. /web/assets/images/icon-add.png "></image>

</wxc-minibar>
</div>

<list class= "List" >

<!--list Container--
<cell class= "List-cell" v-for= "num in list" @click = "jump (' Employedit ', 1)" >
<div class= "List-box" >
<image class= "menu-img" src= ". /.. /.. /web/assets/images/icon-find-maintenance.png "></image>

<span class= "List-m" >
<text class= "Set-name" >{{num.employeename+ "Employees"}}</text>
<!--<text class= "set-addr" >{{num.employeePhone}}</text>-
</span>

<image class= "Icon-triggle" src= ". /.. /.. /web/assets/images/icon-triggle.png "></image>
</span>
</div>
</cell>
</list>
</div>
</template>

<script>


Import {wxcminibar,wxccell,wxctabpage, Wxcpanitem, Utils, bindenv} from ' Weex-ui ';
Not change.
Const modal = Weex.requiremodule (' modal ');
Defining variables
var stream = weex.requiremodule (' stream ');


Export Default {
Component
Components: {Wxcminibar,wxccell},
Data () {
return{
Height:88,
Titles: ' Employee Management ',
Define List
List: []
}
},



Created:function () {
var me = this;


},

Installation
Mounted:function () {
var me = this;
Console.log (6666666666666);
Data reception Issue
Stream.fetch ({
Method: ' POST ',
URL: '/api/employee/findall?name= ' +1,
Type: ' JSON '
}, function (ret) {
if (!ret.ok) {
Console.log ("123");
Me.getjsonpresult = "Request Failed";
}else{
Me.list = Ret.data;
Console printing similar to alert ()

Console.log (me.list[0].employeename+ "printed in");
}
Response
},function (response) {
Make progress
Console.log (' Get Jsonp in progress: ' +response.length);
Number of bytes Received
Me.getjsonpresult = "Hello!!!:" +RESPONSE.LENGTH;
Console.log (' Last return: ' +response.length);

});
},


/*
Stream Demo Demo
Stream.fetch ({
Method: ' POST ',
Url:post_url,
Type: ' JSON '
}, function (ret) {
if (!ret.ok) {

Me.postresult = "Request Failed";
}else{
Console.log (' Get: ' +json.stringify (ret));
Me.postresult = Json.stringify (Ret.data);
}
},function (response) {
Console.log (' Get in Progress: ' +response.length);
Me.postresult = "Bytes Received:" +response.length;
});
*/


Estimate
Beforecreate:function () {
Document Tag Name
document.getElementsByTagName ("Body") [0].style.backgroundcolor= "#f4f4f4";
},
Methods: {

Toparams (obj) {
var param = "";
for (const name in obj) {
if (typeof obj[name]! = ' function ') {
param + = "&" + "=" + encodeURI (Obj[name]);
}
}
return param.substring (1);
},


Small left button
Minibarleftbuttonclick () {
},
Small right button
Minibarrightbuttonclick () {
Modal.toast ({' Message ': ' Click rightbutton! ', ' Duration ': 1});
},
Click
Wxccellclicked (e) {
Console.log (e)
},
Jump
Jump (Urlname,id) {
this. $router. Push ({Name:urlname,params:{id:id}});

/* The first parameter is a jump path, the second parameter is the agent id*/
this. $router. Push ({Name:urlname,params:{id:id}});
}
}
};

</script>
<style scoped>
. header{
z-index:9999;
position:fixed;
top:0;
width:100%;
border-bottom:1px solid #e5e5e5;
}
. icon-add{
width:29px;
height:29px;
}
. container{
padding-top:88px;
}
. list,.list-cell{
width:750px;
}
. list{
padding-bottom:98px;
}
. list-cell{
PADDING:24PX 20px;
border-bottom:1px solid #f4f4f4;
Background-color: #fff;
}
. list-box{
width:100%;
Flex-direction:row;
}
. text-name{
margin-bottom:16px;
font-size:28px;
Color: #333333;
}

. list-m{
Flex:1;
padding:0 0 0 20px;
}
. list-r{
padding-top:10px;
}

. Text-status.color-has. color-n{
Display:inline-block;
Padding:0 4px;
font-size:26px;
Background-color: #e5e5e5;
Color: #999;
border-radius:4px;
}
. set-name{
font-size:28px;
line-height:100px;
Color: #333333;
}
. icon-triggle{
Position:absolute;
right:20px;
top:50%;
Transform:translatey (-50%);
width:17px;
height:28px;
}
. menu-img{
width:100px;
height:100px;
border-radius:4px;
}

</style>

Vue page for reading database information in app development

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.